Author: anil.saldhana(a)jboss.com
Date: 2011-04-25 22:53:19 -0400 (Mon, 25 Apr 2011)
New Revision: 914
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java
Log:
handle the callbacks properly with tracing
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java 2011-04-26
02:00:06 UTC (rev 913)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java 2011-04-26
02:53:19 UTC (rev 914)
@@ -168,6 +168,8 @@
{
private final Logger log = Logger.getLogger(AbstractSTSLoginModule.class);
+ private final boolean trace = log.isTraceEnabled();
+
/**
* Key used in share state map when LMs are stacked.
*/
@@ -466,7 +468,26 @@
{
getCallbackHandler().handle(new Callback[]
{nameCallback, passwordCallback});
- builder.username(nameCallback.getName()).password(new
String(passwordCallback.getPassword()));
+ String userNameStr = nameCallback.getName();
+ if (StringUtil.isNotNull(userNameStr))
+ {
+ builder.username(userNameStr);
+ }
+ else
+ {
+ if (trace)
+ log.trace("UserName from callback is null");
+ }
+ char[] passChars = passwordCallback.getPassword();
+ if (passChars != null)
+ {
+ builder.password(new String(passChars));
+ }
+ else
+ {
+ if (trace)
+ log.trace("Password from callback is null");
+ }
}
catch (final IOException e)
{
Show replies by date