[jboss-cvs] Picketlink SVN: r237 - in federation/trunk: picketlink-webapps/seam-sp/src/main/java/org/picketlink/identity/seam/federation and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue May 4 14:50:20 EDT 2010
Author: anil.saldhana at jboss.com
Date: 2010-05-04 14:50:19 -0400 (Tue, 04 May 2010)
New Revision: 237
Added:
federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SeamSamlPrincipal.java
Removed:
federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlPrincipal.java
Modified:
federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticationFilter.java
federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticator.java
federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlMessageFactory.java
federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlSingleLogoutSender.java
federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlSingleSignOnReceiver.java
federation/trunk/picketlink-webapps/seam-sp/src/main/java/org/picketlink/identity/seam/federation/Authenticator.java
Log:
PLFED-69: Rename SamlPrincipal to SeamSamlPrincipal
Modified: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticationFilter.java
===================================================================
--- federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticationFilter.java 2010-05-04 17:01:39 UTC (rev 236)
+++ federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticationFilter.java 2010-05-04 18:50:19 UTC (rev 237)
@@ -191,7 +191,7 @@
{
throw new RuntimeException("User not logged in.");
}
- SamlPrincipal principal = (SamlPrincipal) identity.getPrincipal();
+ SeamSamlPrincipal principal = (SeamSamlPrincipal) identity.getPrincipal();
SamlIdentityProvider idp = principal.getIdentityProvider();
if (!(idp instanceof SamlIdentityProvider))
{
Modified: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticator.java
===================================================================
--- federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticator.java 2010-05-04 17:01:39 UTC (rev 236)
+++ federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticator.java 2010-05-04 18:50:19 UTC (rev 237)
@@ -105,7 +105,7 @@
{
throw new RuntimeException("Not logged in");
}
- if (!(identity.getPrincipal() instanceof SamlPrincipal))
+ if (!(identity.getPrincipal() instanceof SeamSamlPrincipal))
{
throw new RuntimeException("Single logout is only supported for SAML");
}
Modified: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlMessageFactory.java
===================================================================
--- federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlMessageFactory.java 2010-05-04 17:01:39 UTC (rev 236)
+++ federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlMessageFactory.java 2010-05-04 18:50:19 UTC (rev 237)
@@ -108,7 +108,7 @@
return authnRequest;
}
- public LogoutRequestType createLogoutRequest(SamlPrincipal principal) throws ConfigurationException
+ public LogoutRequestType createLogoutRequest(SeamSamlPrincipal principal) throws ConfigurationException
{
ObjectFactory objectFactory = new ObjectFactory();
org.picketlink.identity.federation.saml.v2.assertion.ObjectFactory assertionObjectFactory = new org.picketlink.identity.federation.saml.v2.assertion.ObjectFactory();
Deleted: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlPrincipal.java
===================================================================
--- federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlPrincipal.java 2010-05-04 17:01:39 UTC (rev 236)
+++ federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlPrincipal.java 2010-05-04 18:50:19 UTC (rev 237)
@@ -1,103 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.picketlink.identity.seam.federation;
-
-import java.security.Principal;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.picketlink.identity.federation.saml.v2.assertion.AssertionType;
-import org.picketlink.identity.federation.saml.v2.assertion.AttributeType;
-import org.picketlink.identity.federation.saml.v2.assertion.NameIDType;
-import org.picketlink.identity.seam.federation.configuration.SamlIdentityProvider;
-
-/**
-* @author Marcel Kolsteren
-* @since Jan 28, 2010
-*/
-public class SamlPrincipal implements Principal
-{
- private NameIDType nameId;
-
- private SamlIdentityProvider identityProvider;
-
- private List<AttributeType> attributes = new LinkedList<AttributeType>();
-
- private String sessionIndex;
-
- private AssertionType assertion;
-
- public NameIDType getNameId()
- {
- return nameId;
- }
-
- public void setNameId(NameIDType nameId)
- {
- this.nameId = nameId;
- }
-
- public SamlIdentityProvider getIdentityProvider()
- {
- return identityProvider;
- }
-
- public void setIdentityProvider(SamlIdentityProvider identityProvider)
- {
- this.identityProvider = identityProvider;
- }
-
- public List<AttributeType> getAttributes()
- {
- return attributes;
- }
-
- public void setAttributes(List<AttributeType> attributes)
- {
- this.attributes = attributes;
- }
-
- public String getSessionIndex()
- {
- return sessionIndex;
- }
-
- public void setSessionIndex(String sessionIndex)
- {
- this.sessionIndex = sessionIndex;
- }
-
- public AssertionType getAssertion()
- {
- return assertion;
- }
-
- public void setAssertion(AssertionType assertion)
- {
- this.assertion = assertion;
- }
-
- public String getName()
- {
- return nameId.getValue();
- }
-}
Modified: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlSingleLogoutSender.java
===================================================================
--- federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlSingleLogoutSender.java 2010-05-04 17:01:39 UTC (rev 236)
+++ federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlSingleLogoutSender.java 2010-05-04 18:50:19 UTC (rev 237)
@@ -53,7 +53,7 @@
public void sendSingleLogoutRequestToIDP(HttpServletRequest request, HttpServletResponse response, Identity identity)
{
- SamlPrincipal principal = (SamlPrincipal) identity.getPrincipal();
+ SeamSamlPrincipal principal = (SeamSamlPrincipal) identity.getPrincipal();
SamlIdentityProvider idp = (SamlIdentityProvider) principal.getIdentityProvider();
LogoutRequestType logoutRequest;
try
Modified: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlSingleSignOnReceiver.java
===================================================================
--- federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlSingleSignOnReceiver.java 2010-05-04 17:01:39 UTC (rev 236)
+++ federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlSingleSignOnReceiver.java 2010-05-04 18:50:19 UTC (rev 237)
@@ -111,7 +111,7 @@
throw new RuntimeException("IDP response does not contain assertions");
}
- SamlPrincipal principal = getAuthenticatedUser(response, requestContext);
+ SeamSamlPrincipal principal = getAuthenticatedUser(response, requestContext);
if (principal == null)
{
try
@@ -131,15 +131,15 @@
}
}
- private SamlPrincipal getAuthenticatedUser(ResponseType responseType, RequestContext requestContext)
+ private SeamSamlPrincipal getAuthenticatedUser(ResponseType responseType, RequestContext requestContext)
{
- SamlPrincipal principal = null;
+ SeamSamlPrincipal principal = null;
for (Object assertion : responseType.getAssertionOrEncryptedAssertion())
{
if (assertion instanceof AssertionType)
{
- SamlPrincipal assertionSubject = handleAssertion((AssertionType) assertion, requestContext);
+ SeamSamlPrincipal assertionSubject = handleAssertion((AssertionType) assertion, requestContext);
if (principal == null)
{
principal = assertionSubject;
@@ -158,7 +158,7 @@
return principal;
}
- private SamlPrincipal handleAssertion(AssertionType assertion, RequestContext requestContext)
+ private SeamSamlPrincipal handleAssertion(AssertionType assertion, RequestContext requestContext)
{
try
{
@@ -187,7 +187,7 @@
return null;
}
- SamlPrincipal principal = new SamlPrincipal();
+ SeamSamlPrincipal principal = new SeamSamlPrincipal();
principal.setAssertion(assertion);
principal.setSessionIndex(authnStatement.getSessionIndex());
principal.setNameId(nameId);
@@ -286,7 +286,7 @@
}
}
- private void loginUser(HttpServletRequest httpRequest, HttpServletResponse httpResponse, SamlPrincipal principal,
+ private void loginUser(HttpServletRequest httpRequest, HttpServletResponse httpResponse, SeamSamlPrincipal principal,
RequestContext requestContext)
{
if (identity.isLoggedIn())
Added: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SeamSamlPrincipal.java
===================================================================
--- federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SeamSamlPrincipal.java (rev 0)
+++ federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SeamSamlPrincipal.java 2010-05-04 18:50:19 UTC (rev 237)
@@ -0,0 +1,103 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.picketlink.identity.seam.federation;
+
+import java.security.Principal;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.picketlink.identity.federation.saml.v2.assertion.AssertionType;
+import org.picketlink.identity.federation.saml.v2.assertion.AttributeType;
+import org.picketlink.identity.federation.saml.v2.assertion.NameIDType;
+import org.picketlink.identity.seam.federation.configuration.SamlIdentityProvider;
+
+/**
+* @author Marcel Kolsteren
+* @since Jan 28, 2010
+*/
+public class SeamSamlPrincipal implements Principal
+{
+ private NameIDType nameId;
+
+ private SamlIdentityProvider identityProvider;
+
+ private List<AttributeType> attributes = new LinkedList<AttributeType>();
+
+ private String sessionIndex;
+
+ private AssertionType assertion;
+
+ public NameIDType getNameId()
+ {
+ return nameId;
+ }
+
+ public void setNameId(NameIDType nameId)
+ {
+ this.nameId = nameId;
+ }
+
+ public SamlIdentityProvider getIdentityProvider()
+ {
+ return identityProvider;
+ }
+
+ public void setIdentityProvider(SamlIdentityProvider identityProvider)
+ {
+ this.identityProvider = identityProvider;
+ }
+
+ public List<AttributeType> getAttributes()
+ {
+ return attributes;
+ }
+
+ public void setAttributes(List<AttributeType> attributes)
+ {
+ this.attributes = attributes;
+ }
+
+ public String getSessionIndex()
+ {
+ return sessionIndex;
+ }
+
+ public void setSessionIndex(String sessionIndex)
+ {
+ this.sessionIndex = sessionIndex;
+ }
+
+ public AssertionType getAssertion()
+ {
+ return assertion;
+ }
+
+ public void setAssertion(AssertionType assertion)
+ {
+ this.assertion = assertion;
+ }
+
+ public String getName()
+ {
+ return nameId.getValue();
+ }
+}
Modified: federation/trunk/picketlink-webapps/seam-sp/src/main/java/org/picketlink/identity/seam/federation/Authenticator.java
===================================================================
--- federation/trunk/picketlink-webapps/seam-sp/src/main/java/org/picketlink/identity/seam/federation/Authenticator.java 2010-05-04 17:01:39 UTC (rev 236)
+++ federation/trunk/picketlink-webapps/seam-sp/src/main/java/org/picketlink/identity/seam/federation/Authenticator.java 2010-05-04 18:50:19 UTC (rev 237)
@@ -36,9 +36,9 @@
{
public Boolean internalAuthenticate(Principal principal, List<String> roles)
{
- if (principal instanceof SamlPrincipal)
+ if (principal instanceof SeamSamlPrincipal)
{
- SamlPrincipal samlPrincipal = (SamlPrincipal) principal;
+ SeamSamlPrincipal samlPrincipal = (SeamSamlPrincipal) principal;
if (samlPrincipal.getName().equals("employee"))
{
More information about the jboss-cvs-commits
mailing list