Updates from March, 2010 Toggle Comment Threads | Keyboard Shortcuts

  • Subinkrishna Gopi 3:28 pm on March 25, 2010 Permalink |
    Tags: authentication, base 64, encoding, , , security,   

    Handling HTTP authentication in Java 

    Google Chrome (Ubuntu 9.10)

    Microsoft IE 8 (Windows XP)

    Most of us might have got this pop up when we browse through some websites – especially in intranets. And it’s perfectly fine for the administrator (a.k.a. webmaster) to put such restrictions on users to enhance the information security. Because that’s what a security engineer is expected to do !

    But what if we have to access the resource through our Java code? How to we handle that? I have faced this issue when I was writing a module to crawl through a secured website using HTTPunit.

    We just need to set the Authorization header with the Base64 encoded username and password. Here is a sample code:

    String usernameAndPassword = "myUsername" + ":" + "myPa$$word";
    String encodedString = new sun.misc.BASE64Encoder().encode (usernameAndPassword.getBytes());
    httpConnection.setRequestProperty("Authorization", "Basic " + encodedString);

    How Base 64 encoding works?

  • Subinkrishna Gopi 2:54 pm on March 25, 2010 Permalink |
    Tags: , chrome, , , ,   

    Gmail or Google Chrome ! Who is the culprit? 

    I am not able to access Gmail!
    I am not able to access Gmail from Google Chrome!
    I am not able to access Gmail from Google Chrome in Ubuntu!

    But I can access it in FireFox! So whom should I put the blame on? Gmail, Chrome or Ubuntu?

    The behavior is li’l inconsistent. Sometimes a page refresh works, but most of the times it doesn’t !

  • Subinkrishna Gopi 2:57 pm on March 20, 2010 Permalink |
    Tags: , , serialization   

    Today’s read: How Java serialization works ! 

    Have you ever wondered what is happening behind the scenes of Java serialization ? If your answer is YES, this one is for you. This is a really good one. I will recommend all to read this.

    Read the article: http://www.javaworld.com/community/node/2915

    If you are interested in more details, you can read Sun’s Java object serialization specification. You can get the specification from here: http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc