Author: anil.saldhana(a)jboss.com
Date: 2010-12-09 17:01:40 -0500 (Thu, 09 Dec 2010)
New Revision: 593
Modified:
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java
Log:
check for null
Modified:
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java
===================================================================
---
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java 2010-12-09
22:00:15 UTC (rev 592)
+++
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java 2010-12-09
22:01:40 UTC (rev 593)
@@ -50,6 +50,7 @@
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AssertionType;
import
org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeStatementType;
import
org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeStatementType.ASTChoiceType;
+import
org.picketlink.identity.federation.newmodel.saml.v2.assertion.SubjectType.STSubType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeType;
import
org.picketlink.identity.federation.newmodel.saml.v2.assertion.EncryptedAssertionType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.NameIDType;
@@ -358,7 +359,13 @@
/*JAXBElement<NameIDType> jnameID = (JAXBElement<NameIDType>)
subject.getContent().get(0);
NameIDType nameID = jnameID.getValue();
*/
- NameIDType nameID = (NameIDType) subject.getSubType().getBaseID();
+ STSubType subType = subject.getSubType();
+ if( subType == null )
+ throw new RuntimeException( "Unable to find subtype via subject"
);
+ NameIDType nameID = (NameIDType) subType.getBaseID();
+
+ if( nameID == null )
+ throw new RuntimeException( "Unable to find username via subject"
);
final String userName = nameID.getValue();
List<String> roles = new ArrayList<String>();
Show replies by date