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...
Sharon_Lucas_55
Nimbostratus
Jul 13, 2010Encoding the password that contains a "@" character as follows did not work for me in my Java program. It encoded the password (replaced the @ with %40, but authentication still failed. Tue Jul 13 15:17:33 2010
try
{
fPassword = URLEncoder.encode("xxxxxx@xxx", "UTF-8");
}
catch (UnsupportedEncodingException ex)
{
System.out.println("\nERROR: Cannot encode F5 password. " + ex.toString());
System.exit(1);
}
fEndpoint = "https://" + username + ":" + password + "@" +
hostname + ":" + port + "/iControl/iControlPortal.cgi";
So, then I tried using the iControl binding stub's setPassword method passing it the encoded password instead of putting the password in the endpoint as follows. It still fails with an Authentication Error:
try
{
fPassword = URLEncoder.encode("xxxxxx@xxx", "UTF-8");
}
catch (UnsupportedEncodingException ex)
{
System.out.println(
"\nERROR: Cannot encode F5 password. " + ex.toString());
System.exit(1);
}
// Don't include the password in the endpoint
fEndpoint = "https://" + username + "@" +
hostname + ":" + port + "/iControl/iControlPortal.cgi";
iControl.SystemSystemInfoBindingStub m_systemInfo =
(iControl.SystemSystemInfoBindingStub)
new iControl.SystemSystemInfoLocator().getSystemSystemInfoPort(
new java.net.URL(fEndpoint));
// Set the password
m_systemInfo.setPassword(fPassword);
iControl.SystemProductInformation productInfo =
m_systemInfo.get_product_information();
I also tried removing the username from the endpoint and using setUsername() in addition to setPassword() to set the username and password. It still failed.
Any ideas on what I'm doing wrong?
Here's the Authentication Error information:
AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (401)F5 Authorization Required
faultActor:
faultNode:
faultDetail:
{}:return code: 401
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Authentication required!
Authentication required!
This server could not verify that you are authorized to access
the URL "/iControl/iControlPortal.cgi".
You either supplied the wrong credentials (e.g., bad password), or your
browser doesn't understand how to supply the credentials required.
In case you are allowed to request the document, please
check your user-id and password and try again.
Error 401
{http://xml.apache.org/axis/}HttpErrorCode:401
(401)F5 Authorization Required
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at iControl.SystemSystemInfoBindingStub.get_product_information(SystemSystemInfoBindingStub.java:1538)
at F5Config.checkSystemVersion(F5Config.java:1530)
at F5Proxy.createOrUpdateNRPC_iRule(F5Proxy.java:1183)
at F5Proxy.main(F5Proxy.java:1286)
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