Forum Discussion
Sharon_Lucas_55
Nimbostratus
Apr 28, 2010Problem authenticating if password contains a @
I'm using the iControl SDK to create a Java application that automates configuring BIG-IP.
If my admin password for BIG-IP does not contain a @, authentication to the BIG-IP host via my Jav...
Jul 13, 2010
I'm still trying to figure out why you are passing passwords along in the URI when you can use the lower level classes to do it for you.
I'd recommend using the iControl library for Java that has all the compiled interface proxy code built in with a iControl.Interfaces class wrapper that handles all the self-signed cert and authentication management for you.
The generated binding stub classes are derived from the org.apache.axis.client.Stub class which has a "setPassword()" method in it that allows you to insert the authenticate headers in the request.
If you really don't want to use the iControl library, and if so, I'd like to hear why, and you aren't using Apache Axis for the transport library, then the next best approach would be to generate the authenticate header yourself. You'll want to add a header named "Authorization" with the value of "Basic user:pass" with user:pass being base64 encoded. I'm not sure about the java code to do this, but with Perl, it looks like this:
eval { $SystemInfo->transport->http_request->header
(
'Authorization' =>
'Basic ' . MIME::Base64::encode("$sUID:$sPWD", '')
); };
I know there are ways to add HTTP headers with the java libraries so I'm sure the logic would be the same.
This method will work on all versions of LTM back to 4.5.
-Joe
-Joe
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects