Picketlink SVN: r809 - in federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2: util and 1 other directory.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-03-15 11:51:49 -0400 (Tue, 15 Mar 2011)
New Revision: 809
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/constants/X500SAMLProfileConstants.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/StatementUtil.java
Log:
update the x500 constants
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/constants/X500SAMLProfileConstants.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/constants/X500SAMLProfileConstants.java 2011-03-11 19:18:19 UTC (rev 808)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/constants/X500SAMLProfileConstants.java 2011-03-15 15:51:49 UTC (rev 809)
@@ -22,20 +22,175 @@
package org.picketlink.identity.federation.core.saml.v2.constants;
/**
+ * X500 SAML Profile Constants
+ * Adapted from http://code.google.com/p/simplesamlphp/source/browse/trunk/attributemap/n...
* @author Anil.Saldhana(a)redhat.com
* @since Sep 11, 2009
*/
public enum X500SAMLProfileConstants
{
-
- CN("commonName", "urn:oid:2.5.4.3"),
- GIVENNAME("givenName","urn:oid:2.5.4.42"),
- EMAIL_ADDRESS("mail", "urn:oid:0.9.2342.19200300.100.1.3"),
- EMPLOYEE_NUMBER("mail", "urn:oid:2.16.840.1.113730.3.1.3"),
- SN("surname", "urn:oid:2.5.4.4"),
- TELEPHONE("telephoneNumber", "urn:oid:2.5.4.20");
+ A_RECORD( "aRecord" , "urn:oid:0.9.2342.19200300.100.1.26" ),
+ ALIASED_ENTRY_NAME( "aliasedEntryName" , "urn:oid:2.5.4.1"),
+ ALIASED_OBJECT_NAME("aliasedObjectName" , "urn:oid:2.5.4.1"),
+ ASSOCIATED_DOMAIN("associatedDomain" , "urn:oid:0.9.2342.19200300.100.1.37"),
+ ASSOCIATED_NAME("associatedName" , "urn:oid:0.9.2342.19200300.100.1.38"),
+ AUDIO("audio" , "urn:oid:0.9.2342.19200300.100.1.55"),
+ AUTHORITY_REVOCATION_LIST("authorityRevocationList" , "urn:oid:2.5.4.38"),
+ BINDING_NAME("buildingName" , "urn:oid:0.9.2342.19200300.100.1.48"),
+ BUSINESS_CATEGORY("businessCategory" , "urn:oid:2.5.4.15"),
+ C("c" , "urn:oid:2.5.4.6"),
+ CA_CERTIFICATE("cACertificate" , "urn:oid:2.5.4.37"),
+ CNAME_RECORD("cNAMERecord" , "urn:oid:0.9.2342.19200300.100.1.31"),
+ CAR_LICENSE("carLicense" , "urn:oid:2.16.840.1.113730.3.1.1"),
+ CRL("certificateRevocationList" , "urn:oid:2.5.4.39"),
+ CN("cn" , "urn:oid:2.5.4.3"),
+ CO("co" , "urn:oid:0.9.2342.19200300.100.1.43"),
+ COMMON_NAME("commonName" , "urn:oid:2.5.4.3"),
+ COUNTRY_NAME("countryName" , "urn:oid:2.5.4.6"),
+ CROSS_CERTIFICATE_PAIR("crossCertificatePair" , "urn:oid:2.5.4.40"),
+ D_IT_REDIRECT("dITRedirect" , "urn:oid:0.9.2342.19200300.100.1.54"),
+ D_SA_QUALITY("dSAQuality" , "urn:oid:0.9.2342.19200300.100.1.49"),
+ DC("dc" , "urn:oid:0.9.2342.19200300.100.1.25"),
+ DELTA_REVOCATION_LIST("deltaRevocationList" , "urn:oid:2.5.4.53"),
+ DEPARTMENT_NUMBER("departmentNumber" , "urn:oid:2.16.840.1.113730.3.1.2"),
+ DESCRIPTION("description" , "urn:oid:2.5.4.13"),
+ DESTINATION_INDICATOR("destinationIndicator" , "urn:oid:2.5.4.27"),
+ DISPLAY_NAME("displayName" , "urn:oid:2.16.840.1.113730.3.1.241"),
+ DISTINGUISHED_NAME("distinguishedName" , "urn:oid:2.5.4.49"),
+ DMD_NAME("dmdName" , "urn:oid:2.5.4.54"),
+ DN_QUALIFIER("dnQualifier" , "urn:oid:2.5.4.46"),
+ DOCUMENT_AUTHOR("documentAuthor" , "urn:oid:0.9.2342.19200300.100.1.14"),
+ DOCUMENT_IDENTIFIER("documentIdentifier" , "urn:oid:0.9.2342.19200300.100.1.11"),
+ DOCUMENT_LOCATION("documentLocation" , "urn:oid:0.9.2342.19200300.100.1.15"),
+ DOCUMENT_PUBLISHER("documentPublisher" , "urn:oid:0.9.2342.19200300.100.1.56"),
+ DOCUMENT_TITLE("documentTitle" , "urn:oid:0.9.2342.19200300.100.1.12"),
+ DOCUMENT_VERSION("documentVersion" , "urn:oid:0.9.2342.19200300.100.1.13"),
+ DOMAIN_COMPONENT("domainComponent" , "urn:oid:0.9.2342.19200300.100.1.25"),
+ DRINK("drink" , "urn:oid:0.9.2342.19200300.100.1.5"),
+ EDU_ORG_HOMEPAGEURI("eduOrgHomePageURI" , "urn:oid:1.3.6.1.4.1.5923.1.2.1.2"),
+ EDU_ORG_IDENTITY_AUTHN_POLICYURI("eduOrgIdentityAuthNPolicyURI" , "urn:oid:1.3.6.1.4.1.5923.1.2.1.3"),
+ EDU_ORG_LEGALNAME("eduOrgLegalName" , "urn:oid:1.3.6.1.4.1.5923.1.2.1.4"),
+ EDU_ORG_SUPERIORURI("eduOrgSuperiorURI" , "urn:oid:1.3.6.1.4.1.5923.1.2.1.5"),
+ EDU_ORG_WHITEPAGESURI("eduOrgWhitePagesURI" , "urn:oid:1.3.6.1.4.1.5923.1.2.1.6"),
+ EDU_PERSON_AFFLIATION("eduPersonAffiliation" , "urn:oid:1.3.6.1.4.1.5923.1.1.1.1"),
+ EDU_PERSON_ENTITLEMENT("eduPersonEntitlement" , "urn:oid:1.3.6.1.4.1.5923.1.1.1.7"),
+ EDU_PERSON_NICKNAME("eduPersonNickname" , "urn:oid:1.3.6.1.4.1.5923.1.1.1.2"),
+ EDU_PERSON_ORG_DN("eduPersonOrgDN" , "urn:oid:1.3.6.1.4.1.5923.1.1.1.3"),
+ EDU_PERSION_ORG_UNIT_DN("eduPersonOrgUnitDN" , "urn:oid:1.3.6.1.4.1.5923.1.1.1.4"),
+ EDU_PERSON_PRIMARY_AFFLIATION("eduPersonPrimaryAffiliation" , "urn:oid:1.3.6.1.4.1.5923.1.1.1.5"),
+ EDU_PERSON_PRIMARY_ORG_UNIT_DN("eduPersonPrimaryOrgUnitDN" , "urn:oid:1.3.6.1.4.1.5923.1.1.1.8"),
+ EDU_PERSON_PRINCIPAL_NAME("eduPersonPrincipalName" , "urn:oid:1.3.6.1.4.1.5923.1.1.1.6"),
+ EDU_PERSON_SCOPED_AFFLIATION("eduPersonScopedAffiliation" , "urn:oid:1.3.6.1.4.1.5923.1.1.1.9"),
+ EDU_PERSON_TARGETED_ID("eduPersonTargetedID" , "urn:oid:1.3.6.1.4.1.5923.1.1.1.10"),
+ EMAIL("email" , "urn:oid:1.2.840.113549.1.9.1"),
+ EMAIL_ADDRESS("emailAddress" , "urn:oid:1.2.840.113549.1.9.1"),
+ EMPLOYEE_NUMBER("employeeNumber" , "urn:oid:2.16.840.1.113730.3.1.3"),
+ EMPLOYEE_TYPE("employeeType" , "urn:oid:2.16.840.1.113730.3.1.4"),
+ ENHANCED_SEARCH_GUIDE("enhancedSearchGuide" , "urn:oid:2.5.4.47"),
+ FAX_TELEPHONE_NUMBER("facsimileTelephoneNumber" , "urn:oid:2.5.4.23"),
+ FAVORITE_DRINK("favouriteDrink" , "urn:oid:0.9.2342.19200300.100.1.5"),
+ FAX("fax" , "urn:oid:2.5.4.23"),
+ FEDERATION_FEIDE_SCHEMA_VERSION("federationFeideSchemaVersion" , "urn:oid:1.3.6.1.4.1.2428.90.1.9"),
+ FRIENDLY_COUNTRY_NAME("friendlyCountryName" , "urn:oid:0.9.2342.19200300.100.1.43"),
+ GENERATION_QUALIFIER("generationQualifier" , "urn:oid:2.5.4.44"),
+ GIVEN_NAME("givenName" , "urn:oid:2.5.4.42"),
+ GN("gn" , "urn:oid:2.5.4.42"),
+ HOME_PHONE("homePhone" , "urn:oid:0.9.2342.19200300.100.1.20"),
+ HOME_POSTAL_ADDRESS("homePostalAddress" , "urn:oid:0.9.2342.19200300.100.1.39"),
+ HOME_TELEPHONE_NUMBER("homeTelephoneNumber" , "urn:oid:0.9.2342.19200300.100.1.20"),
+ HOST("host" , "urn:oid:0.9.2342.19200300.100.1.9"),
+ HOUSE_IDENTIFIER("houseIdentifier" , "urn:oid:2.5.4.51"),
+ INFO("info" , "urn:oid:0.9.2342.19200300.100.1.4"),
+ INITIALS("initials" , "urn:oid:2.5.4.43"),
+ INTERNATIONAL_ISDN_NUMBER("internationaliSDNNumber" , "urn:oid:2.5.4.25"),
+ IS_MEMBEROF("isMemberOf" , "urn:oid:1.3.6.1.4.1.5923.1.5.1.1"),
+ JANET_MAILBOX("janetMailbox" , "urn:oid:0.9.2342.19200300.100.1.46"),
+ JPEG_PHOTO("jpegPhoto" , "urn:oid:0.9.2342.19200300.100.1.60"),
+ KNOWLEDGE_INFORMATION("knowledgeInformation" , "urn:oid:2.5.4.2"),
+ L("l" , "urn:oid:2.5.4.7"),
+ LABELED_URI("labeledURI" , "urn:oid:1.3.6.1.4.1.250.1.57"),
+ LOCALITY_NAME("localityName" , "urn:oid:2.5.4.7"),
+ M_DRECORD("mDRecord" , "urn:oid:0.9.2342.19200300.100.1.27"),
+ M_XRECORD("mXRecord" , "urn:oid:0.9.2342.19200300.100.1.28"),
+ MAIL("mail" , "urn:oid:0.9.2342.19200300.100.1.3"),
+ MAIL_PREFERENCEOPTION("mailPreferenceOption" , "urn:oid:0.9.2342.19200300.100.1.47"),
+ MANAGER("manager" , "urn:oid:0.9.2342.19200300.100.1.10"),
+ MEMBER("member" , "urn:oid:2.5.4.31"),
+ MOBILE("mobile" , "urn:oid:0.9.2342.19200300.100.1.41"),
+ MOBILE_TELEPHONE_NUMBER("mobileTelephoneNumber" , "urn:oid:0.9.2342.19200300.100.1.41"),
+ N_SRECORD("nSRecord" , "urn:oid:0.9.2342.19200300.100.1.29"),
+ NAME("name" , "urn:oid:2.5.4.41"),
+ NOR_EDU_ORG_ACRONYM("norEduOrgAcronym" , "urn:oid:1.3.6.1.4.1.2428.90.1.6"),
+ NOR_EDU_ORG_NIN("norEduOrgNIN" , "urn:oid:1.3.6.1.4.1.2428.90.1.12"),
+ NOR_EDU_ORG_SCHEMA_VERSION("norEduOrgSchemaVersion" , "urn:oid:1.3.6.1.4.1.2428.90.1.11"),
+ NOR_EDU_ORG_UNIQUE_IDENTIFIER("norEduOrgUniqueIdentifier" , "urn:oid:1.3.6.1.4.1.2428.90.1.7"),
+ NOR_EDU_ORG_UNIQUE_NUMBER("norEduOrgUniqueNumber" , "urn:oid:1.3.6.1.4.1.2428.90.1.1"),
+ NOR_EDU_ORG_UNIT_UNIQUE_IDENTIFIER("norEduOrgUnitUniqueIdentifier" , "urn:oid:1.3.6.1.4.1.2428.90.1.8"),
+ NOR_EDU_ORG_UNIT_UNIQUE_NUMBER("norEduOrgUnitUniqueNumber" , "urn:oid:1.3.6.1.4.1.2428.90.1.2"),
+ NOR_EDU_PERSON_BIRTH_DATE("norEduPersonBirthDate" , "urn:oid:1.3.6.1.4.1.2428.90.1.3"),
+ NOR_EDU_PERSON_LIN("norEduPersonLIN" , "urn:oid:1.3.6.1.4.1.2428.90.1.4"),
+ NOR_EDU_PERSON_NIN("norEduPersonNIN" , "urn:oid:1.3.6.1.4.1.2428.90.1.5"),
+ O("o" , "urn:oid:2.5.4.10"),
+ OBJECT_CLASS("objectClass" , "urn:oid:2.5.4.0"),
+ ORGANIZATION_NAME("organizationName" , "urn:oid:2.5.4.10"),
+ ORGANIZATIONAL_STATUS("organizationalStatus" , "urn:oid:0.9.2342.19200300.100.1.45"),
+ ORGANIZATIONAL_UNIT_NAME("organizationalUnitName" , "urn:oid:2.5.4.11"),
+ OTHER_MAIL_BOX("otherMailbox" , "urn:oid:0.9.2342.19200300.100.1.22"),
+ OU("ou" , "urn:oid:2.5.4.11"),
+ OWNER("owner" , "urn:oid:2.5.4.32"),
+ PAGER("pager" , "urn:oid:0.9.2342.19200300.100.1.42"),
+ PAGER_TELEPHONE_NUMBER("pagerTelephoneNumber" , "urn:oid:0.9.2342.19200300.100.1.42"),
+ PERSONAL_SIGNATURE("personalSignature" , "urn:oid:0.9.2342.19200300.100.1.53"),
+ PERSONAL_TITLE("personalTitle" , "urn:oid:0.9.2342.19200300.100.1.40"),
+ PHOTO("photo" , "urn:oid:0.9.2342.19200300.100.1.7"),
+ PHYSICAL_DELIVERY_OFFICE_NAME("physicalDeliveryOfficeName" , "urn:oid:2.5.4.19"),
+ PKCS_9_EMAIL("pkcs9email" , "urn:oid:1.2.840.113549.1.9.1"),
+ POST_OFFICE_BOX("postOfficeBox" , "urn:oid:2.5.4.18"),
+ POSTAL_ADDRESS("postalAddress" , "urn:oid:2.5.4.16"),
+ POSTAL_CODE("postalCode" , "urn:oid:2.5.4.17"),
+ PREFERRED_DELIVERY_METHOD("preferredDeliveryMethod" , "urn:oid:2.5.4.28"),
+ PREFERRED_LANGUAGE("preferredLanguage" , "urn:oid:2.16.840.1.113730.3.1.39"),
+ PRESENTATION_ADDRESS("presentationAddress" , "urn:oid:2.5.4.29"),
+ PROTOCOL_INFORMATION("protocolInformation" , "urn:oid:2.5.4.48"),
+ PSEUDONYM("pseudonym" , "urn:oid:2.5.4.65"),
+ REGISTERED_ADDRESS("registeredAddress" , "urn:oid:2.5.4.26"),
+ RFC_822_MAILBOX("rfc822Mailbox" , "urn:oid:0.9.2342.19200300.100.1.3"),
+ ROLE_OCCUPANT("roleOccupant" , "urn:oid:2.5.4.33"),
+ ROOM_NUMBER("roomNumber" , "urn:oid:0.9.2342.19200300.100.1.6"),
+ S_OAR_RECORD("sOARecord" , "urn:oid:0.9.2342.19200300.100.1.30"),
+ SEARCH_GUIDE("searchGuide" , "urn:oid:2.5.4.14"),
+ SECRETARY("secretary" , "urn:oid:0.9.2342.19200300.100.1.21"),
+ SEE_ALSO("seeAlso" , "urn:oid:2.5.4.34"),
+ SERIAL_NUMBER("serialNumber" , "urn:oid:2.5.4.5"),
+ SINGLE_LEVEL_QUALITY("singleLevelQuality" , "urn:oid:0.9.2342.19200300.100.1.50"),
+ SN("sn" , "urn:oid:2.5.4.4"),
+ ST("st" , "urn:oid:2.5.4.8"),
+ STATE_OR_PROVINCE_NAME("stateOrProvinceName" , "urn:oid:2.5.4.8"),
+ STREET("street" , "urn:oid:2.5.4.9"),
+ STREET_ADDRESS("streetAddress" , "urn:oid:2.5.4.9"),
+ SUBTREE_MAXIMUM_QUALITY("subtreeMaximumQuality" , "urn:oid:0.9.2342.19200300.100.1.52"),
+ SUBTREE_MINIMUM_QUALITY("subtreeMinimumQuality" , "urn:oid:0.9.2342.19200300.100.1.51"),
+ SUPPORTED_ALGORITHMS("supportedAlgorithms" , "urn:oid:2.5.4.52"),
+ SUPPORTED_APPLICATION_CONTEXT("supportedApplicationContext" , "urn:oid:2.5.4.30"),
+ SURNAME("surname" , "urn:oid:2.5.4.4"),
+ TELEPHONE_NUMBER("telephoneNumber" , "urn:oid:2.5.4.20"),
+ TELETEX_TERMINAL_IDENTIFIER("teletexTerminalIdentifier" , "urn:oid:2.5.4.22"),
+ TELEX_NUMBER("telexNumber" , "urn:oid:2.5.4.21"),
+ TEXT_ENCODED_OR_ADDRESS("textEncodedORAddress" , "urn:oid:0.9.2342.19200300.100.1.2"),
+ TITLE("title" , "urn:oid:2.5.4.12"),
+ UID("uid" , "urn:oid:0.9.2342.19200300.100.1.1"),
+ UNIQUE_IDENTIFIER("uniqueIdentifier" , "urn:oid:0.9.2342.19200300.100.1.44"),
+ UNIQUE_MEMBER("uniqueMember" , "urn:oid:2.5.4.50"),
+ USER_CERTIFICATE("userCertificate" , "urn:oid:2.5.4.36"),
+ USER_CLASS("userClass" , "urn:oid:0.9.2342.19200300.100.1.8"),
+ USER_PKCS12("userPKCS12" , "urn:oid:2.16.840.1.113730.3.1.216"),
+ USER_PASSWORD("userPassword" , "urn:oid:2.5.4.35"),
+ USER_SMIME_CERTIFICATE("userSMIMECertificate" , "urn:oid:2.16.840.1.113730.3.1.40"),
+ USERID("userid" , "urn:oid:0.9.2342.19200300.100.1.1"),
+ X121_ADDRESS("x121Address" , "urn:oid:2.5.4.24"),
+ X500_UNIQUE_IDENTIFIER("x500UniqueIdentifier" , "urn:oid:2.5.4.45");
- private String friendlyName = null;
+ private final String friendlyName = null;
private String uri = null;
private X500SAMLProfileConstants(String friendlyName,
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/StatementUtil.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/StatementUtil.java 2011-03-11 19:18:19 UTC (rev 808)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/StatementUtil.java 2011-03-15 15:51:49 UTC (rev 809)
@@ -48,30 +48,32 @@
*/
public class StatementUtil
{
- public static final QName X500_QNAME = new QName(JBossSAMLURIConstants.X500_NSURI.get(), "Encoding", JBossSAMLURIConstants.X500_PREFIX.get());
-
+ public static final QName X500_QNAME = new QName(JBossSAMLURIConstants.X500_NSURI.get(), "Encoding",
+ JBossSAMLURIConstants.X500_PREFIX.get());
+
/**
* Create an AuthnStatementType given the issue instant and the type of authentication
* @param instant an instanceof {@link XMLGregorianCalendar}
* @param authnContextClassRefValue indicate the type of authentication performed
* @return {@link AuthnStatementType}
*/
- public static AuthnStatementType createAuthnStatement( XMLGregorianCalendar instant, String authnContextClassRefValue )
+ public static AuthnStatementType createAuthnStatement(XMLGregorianCalendar instant, String authnContextClassRefValue)
{
- AuthnStatementType authnStatement = new AuthnStatementType( instant );
-
+ AuthnStatementType authnStatement = new AuthnStatementType(instant);
+
AuthnContextType authnContext = new AuthnContextType();
- AuthnContextClassRefType authnContextClassRef = new AuthnContextClassRefType( URI.create( authnContextClassRefValue ));
-
+ AuthnContextClassRefType authnContextClassRef = new AuthnContextClassRefType(
+ URI.create(authnContextClassRefValue));
+
AuthnContextTypeSequence sequence = (authnContext).new AuthnContextTypeSequence();
- sequence.setClassRef( authnContextClassRef );
- authnContext.setSequence( sequence );
-
- authnStatement.setAuthnContext( authnContext );
-
+ sequence.setClassRef(authnContextClassRef);
+ authnContext.setSequence(sequence);
+
+ authnStatement.setAuthnContext(authnContext);
+
return authnStatement;
}
-
+
/**
* Create an attribute statement with all the attributes
* @param attributes a map with keys from {@link AttributeConstants}
@@ -89,7 +91,7 @@
if (i == 0)
{
//Deal with the X500 Profile of SAML2
- attrStatement = new AttributeStatementType();
+ attrStatement = new AttributeStatementType();
i++;
}
@@ -102,9 +104,9 @@
Collection<?> roles = (Collection<?>) value;
for (Object role : roles)
{
- AttributeType roleAttr = new AttributeType( "Role" );
+ AttributeType roleAttr = new AttributeType("Role");
roleAttr.addAttributeValue(role);
- attrStatement.addAttribute( new ASTChoiceType( roleAttr ));
+ attrStatement.addAttribute(new ASTChoiceType(roleAttr));
}
}
}
@@ -116,30 +118,30 @@
if (AttributeConstants.EMAIL_ADDRESS.equals(key))
{
- att = getX500Attribute( X500SAMLProfileConstants.EMAIL_ADDRESS.get() );
- att.setFriendlyName(X500SAMLProfileConstants.EMAIL_ADDRESS.getFriendlyName());
+ att = getX500Attribute(X500SAMLProfileConstants.EMAIL_ADDRESS.get());
+ att.setFriendlyName(X500SAMLProfileConstants.EMAIL_ADDRESS.getFriendlyName());
}
else if (AttributeConstants.EMPLOYEE_NUMBER.equals(key))
{
- att = getX500Attribute( X500SAMLProfileConstants.EMPLOYEE_NUMBER.get() );
- att.setFriendlyName(X500SAMLProfileConstants.EMPLOYEE_NUMBER.getFriendlyName());
+ att = getX500Attribute(X500SAMLProfileConstants.EMPLOYEE_NUMBER.get());
+ att.setFriendlyName(X500SAMLProfileConstants.EMPLOYEE_NUMBER.getFriendlyName());
}
else if (AttributeConstants.GIVEN_NAME.equals(key))
{
- att = getX500Attribute( X500SAMLProfileConstants.GIVENNAME.get() );
- att.setFriendlyName(X500SAMLProfileConstants.GIVENNAME.getFriendlyName());
+ att = getX500Attribute(X500SAMLProfileConstants.GIVEN_NAME.get());
+ att.setFriendlyName(X500SAMLProfileConstants.GIVEN_NAME.getFriendlyName());
}
else if (AttributeConstants.TELEPHONE.equals(key))
{
- att = getX500Attribute( X500SAMLProfileConstants.TELEPHONE.get() );
- att.setFriendlyName(X500SAMLProfileConstants.TELEPHONE.getFriendlyName());
- att.setName(X500SAMLProfileConstants.TELEPHONE.get());
+ att = getX500Attribute(X500SAMLProfileConstants.TELEPHONE_NUMBER.get());
+ att.setFriendlyName(X500SAMLProfileConstants.TELEPHONE_NUMBER.getFriendlyName());
+ att.setName(X500SAMLProfileConstants.TELEPHONE_NUMBER.get());
}
else
- throw new RuntimeException( "Unknown:" + key );
-
- att.addAttributeValue( value );
- attrStatement.addAttribute( new ASTChoiceType( att ));
+ throw new RuntimeException("Unknown:" + key);
+
+ att.addAttributeValue(value);
+ attrStatement.addAttribute(new ASTChoiceType(att));
}
}
return attrStatement;
@@ -155,16 +157,16 @@
AttributeStatementType attrStatement = new AttributeStatementType();
for (String role : roles)
{
- AttributeType attr = new AttributeType( "Role" );
- attr.addAttributeValue( role );
- attrStatement.addAttribute( new ASTChoiceType( attr ));
+ AttributeType attr = new AttributeType("Role");
+ attr.addAttributeValue(role);
+ attrStatement.addAttribute(new ASTChoiceType(attr));
}
return attrStatement;
}
- private static AttributeType getX500Attribute( String name )
+ private static AttributeType getX500Attribute(String name)
{
- AttributeType att = new AttributeType( name );
+ AttributeType att = new AttributeType(name);
att.getOtherAttributes().put(X500_QNAME, "LDAP");
att.setNameFormat(JBossSAMLURIConstants.ATTRIBUTE_FORMAT_URI.get());
13 years, 1 month
Picketlink SVN: r807 - in idm/branches/2.0.0: picketlink-idm-memory/src/main/java/org/picketlink/idm/impl/store/memory and 1 other directory.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-03-10 13:49:55 -0500 (Thu, 10 Mar 2011)
New Revision: 807
Modified:
idm/branches/2.0.0/assembly/scripts/assembly-distro.xml
idm/branches/2.0.0/assembly/scripts/assembly-single-jar.xml
idm/branches/2.0.0/picketlink-idm-memory/src/main/java/org/picketlink/idm/impl/store/memory/MemoryIdentityStoreRepository.java
Log:
minor cleanup
Modified: idm/branches/2.0.0/assembly/scripts/assembly-distro.xml
===================================================================
--- idm/branches/2.0.0/assembly/scripts/assembly-distro.xml 2011-03-09 19:09:48 UTC (rev 806)
+++ idm/branches/2.0.0/assembly/scripts/assembly-distro.xml 2011-03-10 18:49:55 UTC (rev 807)
@@ -97,6 +97,10 @@
<directory>../picketlink-idm-core/src/main/java</directory>
<outputDirectory>src</outputDirectory>
</fileSet>
+ <fileSet>
+ <directory>../picketlink-idm-memory/src/main/java</directory>
+ <outputDirectory>src</outputDirectory>
+ </fileSet>
<!--
<fileSet>
Modified: idm/branches/2.0.0/assembly/scripts/assembly-single-jar.xml
===================================================================
--- idm/branches/2.0.0/assembly/scripts/assembly-single-jar.xml 2011-03-09 19:09:48 UTC (rev 806)
+++ idm/branches/2.0.0/assembly/scripts/assembly-single-jar.xml 2011-03-10 18:49:55 UTC (rev 807)
@@ -21,6 +21,12 @@
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
+ <directory>${basedir}/../picketlink-idm-memory/target/classes/</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
+
+ <!--
+ <fileSet>
<directory>${basedir}/../picketlink-idm-cache/target/classes/</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
@@ -55,5 +61,8 @@
</excludes>
<outputDirectory>/</outputDirectory>
</fileSet>
+ -->
+
+
</fileSets>
</assembly>
Modified: idm/branches/2.0.0/picketlink-idm-memory/src/main/java/org/picketlink/idm/impl/store/memory/MemoryIdentityStoreRepository.java
===================================================================
--- idm/branches/2.0.0/picketlink-idm-memory/src/main/java/org/picketlink/idm/impl/store/memory/MemoryIdentityStoreRepository.java 2011-03-09 19:09:48 UTC (rev 806)
+++ idm/branches/2.0.0/picketlink-idm-memory/src/main/java/org/picketlink/idm/impl/store/memory/MemoryIdentityStoreRepository.java 2011-03-10 18:49:55 UTC (rev 807)
@@ -22,13 +22,11 @@
package org.picketlink.idm.impl.store.memory;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.picketlink.idm.common.exception.IdentityException;
-import org.picketlink.idm.core.factories.IdentityFactory;
import org.picketlink.idm.spi.configuration.IdentityRepositoryConfigurationContext;
import org.picketlink.idm.spi.configuration.IdentityStoreConfigurationContext;
import org.picketlink.idm.spi.configuration.metadata.IdentityConfigurationMetaData;
@@ -231,9 +229,7 @@
public void setRelationshipProperties(IdentityStoreInvocationContext ctx, IdentityObjectRelationship relationship,
Map<String, String> properties) throws IdentityException, OperationNotSupportedException
- {
-
-
+ {
}
public void removeRelationshipProperties(IdentityStoreInvocationContext ctx,
@@ -268,15 +264,13 @@
public Set<String> getSupportedAttributeNames(IdentityStoreInvocationContext invocationContext,
IdentityObjectType identityType) throws IdentityException
- {
-
+ {
throw new RuntimeException( "NYI" );
}
public Map<String, IdentityObjectAttributeMetaData> getAttributesMetaData(
IdentityStoreInvocationContext invocationContext, IdentityObjectType identityType)
- {
-
+ {
throw new RuntimeException( "NYI" );
}
@@ -288,8 +282,7 @@
public IdentityObjectAttribute getAttribute(IdentityStoreInvocationContext invocationContext,
IdentityObject identity, String name) throws IdentityException
- {
-
+ {
throw new RuntimeException( "NYI" );
}
@@ -332,6 +325,9 @@
{
repoMD = configurationContext.getRepositoryConfigurationMetaData();
storeMD = configurationContext.getConfigurationMetaData().getIdentityStores().get(0);
+
+ if( !storeMD.getClassName().contains( "MemoryIdentityStore"))
+ throw new IdentityException( "Memory Identity Store is not configured" );
}
@@ -342,37 +338,31 @@
public Set<IdentityStore> getConfiguredIdentityStores()
{
-
throw new RuntimeException( "NYI" );
}
public Set<AttributeStore> getConfiguredAttributeStores()
{
-
throw new RuntimeException( "NYI" );
}
public Map<String, IdentityStore> getIdentityStoreMappings()
{
-
throw new RuntimeException( "NYI" );
}
public Map<String, AttributeStore> getAttributeStoreMappings()
{
-
throw new RuntimeException( "NYI" );
}
public IdentityStore getIdentityStore(IdentityObjectType identityObjectType) throws IdentityException
{
-
throw new RuntimeException( "NYI" );
}
public AttributeStore getAttributeStore(IdentityObjectType identityObjectType) throws IdentityException
{
-
throw new RuntimeException( "NYI" );
}
}
\ No newline at end of file
13 years, 1 month
Picketlink SVN: r806 - integration-tests/trunk/common-dist/jbossas/5.1.0.GA.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-03-09 14:09:48 -0500 (Wed, 09 Mar 2011)
New Revision: 806
Modified:
integration-tests/trunk/common-dist/jbossas/5.1.0.GA/jboss-5.1.0.GA-jdk6.zip
Log:
trim the 5.1 zip to just the default profile
Modified: integration-tests/trunk/common-dist/jbossas/5.1.0.GA/jboss-5.1.0.GA-jdk6.zip
===================================================================
(Binary files differ)
13 years, 1 month
Picketlink SVN: r805 - federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-03-09 13:57:35 -0500 (Wed, 09 Mar 2011)
New Revision: 805
Modified:
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostFormAuthenticator.java
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPRedirectFormAuthenticator.java
Log:
adapt to JBAS5.1 and 6 quirkiness with Catalina Request
Modified: federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostFormAuthenticator.java
===================================================================
--- federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostFormAuthenticator.java 2011-03-09 18:56:11 UTC (rev 804)
+++ federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostFormAuthenticator.java 2011-03-09 18:57:35 UTC (rev 805)
@@ -249,7 +249,18 @@
if (dispatch == null)
log.error("Cannot dispatch to the logout page: no request dispatcher:" + this.logOutPage);
else
- dispatch.forward(request, response);
+ {
+ session.expire();
+ try
+ {
+ dispatch.forward(request, response);
+ }
+ catch (Exception e)
+ {
+ //JBAS5.1 and 6 quirkiness
+ dispatch.forward(request.getRequest(), response);
+ }
+ }
return false;
}
@@ -292,8 +303,7 @@
}
catch (Exception e)
{
- if (trace)
- log.trace("Server Exception:", e);
+ log.error("Server Exception:", e);
throw new IOException("Server Exception");
}
}
@@ -320,6 +330,7 @@
}
}//end if
+ log.error("Did not find any SAML Request/Response. Falling back on local Form Authentication if available");
//fallback
return super.authenticate(request, response, loginConfig);
}
Modified: federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPRedirectFormAuthenticator.java
===================================================================
--- federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPRedirectFormAuthenticator.java 2011-03-09 18:56:11 UTC (rev 804)
+++ federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPRedirectFormAuthenticator.java 2011-03-09 18:57:35 UTC (rev 805)
@@ -285,7 +285,18 @@
if (dispatch == null)
log.error("Cannot dispatch to the logout page: no request dispatcher:" + this.logOutPage);
else
- dispatch.forward(request, response);
+ {
+ session.expire();
+ try
+ {
+ dispatch.forward(request, response);
+ }
+ catch (Exception e)
+ {
+ //JBAS5.1 and 6 quirkiness
+ dispatch.forward(request.getRequest(), response);
+ }
+ }
return false;
}
@@ -349,13 +360,13 @@
}
catch (Exception e)
{
- if (trace)
- log.trace("Server Exception:", e);
+ log.error("Server Exception:", e);
throw new IOException("Server Exception");
}
}//end if
+ log.error("Did not find any SAML Request/Response. Falling back on local Form Authentication if available");
//fallback
return super.authenticate(request, response, loginConfig);
}
13 years, 1 month
Picketlink SVN: r804 - in federation/trunk/picketlink-fed-core/src: test/java/org/picketlink/test/identity/federation/core/parser and 1 other directory.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-03-09 13:56:11 -0500 (Wed, 09 Mar 2011)
New Revision: 804
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/StringUtil.java
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/SystemPropertyAsStringUnitTestCase.java
Log:
PLFED-138: allow default values
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/StringUtil.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/StringUtil.java 2011-03-09 18:55:24 UTC (rev 803)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/StringUtil.java 2011-03-09 18:56:11 UTC (rev 804)
@@ -27,7 +27,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-
/**
* Utility dealing with Strings
* @author Anil.Saldhana(a)redhat.com
@@ -43,8 +42,8 @@
public static boolean isNotNull(String str)
{
return str != null && !"".equals(str);
- }
-
+ }
+
/**
* Check whether the string is null or empty
* @param str
@@ -54,50 +53,75 @@
{
return str == null || str.isEmpty();
}
-
+
/**
+ * <p>
* Get the system property value if the string is of the format ${sysproperty}
+ * </p>
+ * <p>
+ * You can insert default value when the system property is not set, by
+ * separating it at the beginning with ::
+ * </p>
+ * <p>
+ * <b>Examples:</b>
+ * </p>
+ *
+ * <p>
+ * ${idp} should resolve to a value if the system property "idp" is set.
+ * </p>
+ * <p>
+ * ${idp::http://localhost:8080} will resolve to http://localhost:8080 if the system property "idp" is not set.
+ * </p>
* @param str
* @return
*/
- public static String getSystemPropertyAsString( String str )
+ public static String getSystemPropertyAsString(String str)
{
- if( str.contains( "${") )
- {
- Pattern pattern = Pattern.compile( "\\$\\{([^}]+)}" );
+ if (str.contains("${"))
+ {
+ Pattern pattern = Pattern.compile("\\$\\{([^}]+)}");
Matcher matcher = pattern.matcher(str);
- StringBuffer buffer = new StringBuffer();
- String sysPropertyValue = null;
+ StringBuffer buffer = new StringBuffer();
+ String sysPropertyValue = null;
- while (matcher.find())
+ while (matcher.find())
{
- sysPropertyValue = SecurityActions.getSystemProperty( matcher.group(1), "" );
- if( sysPropertyValue.isEmpty() )
+ String subString = matcher.group(1);
+ String defaultValue = "";
+
+ //Look for default value
+ if (subString.contains("::"))
{
- throw new IllegalArgumentException( "System Property " + matcher.group(1) + " is not set" );
- }
- matcher.appendReplacement(buffer,sysPropertyValue);
+ int index = subString.indexOf("::");
+ defaultValue = subString.substring(index + 2);
+ }
+ sysPropertyValue = SecurityActions.getSystemProperty(subString, defaultValue);
+ if (sysPropertyValue.isEmpty())
+ {
+ throw new IllegalArgumentException("System Property " + matcher.group(1) + " is not set");
+ }
+ matcher.appendReplacement(buffer, sysPropertyValue);
}
- matcher.appendTail(buffer);
+ matcher.appendTail(buffer);
str = buffer.toString();
}
return str;
}
-
+
/**
* Given a comma separated string, get the tokens as a {@link List}
* @param str
* @return
*/
- public static List<String> tokenize( String str )
+ public static List<String> tokenize(String str)
{
List<String> list = new ArrayList<String>();
StringTokenizer tokenizer = new StringTokenizer(str, ",");
- while( tokenizer.hasMoreTokens() )
+ while (tokenizer.hasMoreTokens())
{
- list.add( tokenizer.nextToken() );
+ list.add(tokenizer.nextToken());
}
return list;
}
Modified: federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/SystemPropertyAsStringUnitTestCase.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/SystemPropertyAsStringUnitTestCase.java 2011-03-09 18:55:24 UTC (rev 803)
+++ federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/SystemPropertyAsStringUnitTestCase.java 2011-03-09 18:56:11 UTC (rev 804)
@@ -38,22 +38,33 @@
@Before
public void setup()
{
- System.setProperty( "test", "anil" );
- System.setProperty( "person", "marcus" );
+ System.setProperty("test", "anil");
+ System.setProperty("person", "marcus");
}
-
+
@Test
public void testSystemProperty() throws Exception
{
- assertEquals( "test" , StringUtil.getSystemPropertyAsString( "test" ) );
- assertEquals( "test/test" , StringUtil.getSystemPropertyAsString( "test/test" ) );
-
- assertEquals( "anil", StringUtil.getSystemPropertyAsString( "${test}" ) );
- assertEquals( "test/anil", StringUtil.getSystemPropertyAsString( "test/${test}" ) );
-
- assertEquals( "anil:anil:marcus//anil", StringUtil.getSystemPropertyAsString( "${test}:${test}:${person}//${test}" ) );
+ assertEquals("test", StringUtil.getSystemPropertyAsString("test"));
+ assertEquals("test/test", StringUtil.getSystemPropertyAsString("test/test"));
+ assertEquals("anil", StringUtil.getSystemPropertyAsString("${test}"));
+ assertEquals("test/anil", StringUtil.getSystemPropertyAsString("test/${test}"));
+
+ assertEquals("anil:anil:marcus//anil", StringUtil.getSystemPropertyAsString("${test}:${test}:${person}//${test}"));
+
//Test if any of the parantheses are not correctly closed
- assertEquals( "anil:anil:marcus//${test", StringUtil.getSystemPropertyAsString( "${test}:${test}:${person}//${test" ) );
+ assertEquals("anil:anil:marcus//${test",
+ StringUtil.getSystemPropertyAsString("${test}:${test}:${person}//${test"));
+
+ //Test the default values
+ assertEquals("http://something", StringUtil.getSystemPropertyAsString("${dummy::http://something}"));
+ assertEquals("http://something__hi",
+ StringUtil.getSystemPropertyAsString("${dummy::http://something}__${to::hi}"));
+ assertEquals("anil:anil:marcus//anilhi",
+ StringUtil.getSystemPropertyAsString("${test}:${test}:${person}//${test}${to::hi}"));
+ assertEquals("anil:anil:marcus//anilhihttp://something",
+ StringUtil
+ .getSystemPropertyAsString("${test}:${test}:${person}//${test}${to::hi}${dummy::http://something}"));
}
}
\ No newline at end of file
13 years, 1 month
Picketlink SVN: r803 - in federation/trunk/picketlink-webapps: employee-post/src/main/webapp/WEB-INF and 10 other directories.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-03-09 13:55:24 -0500 (Wed, 09 Mar 2011)
New Revision: 803
Modified:
federation/trunk/picketlink-webapps/employee-post-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml
federation/trunk/picketlink-webapps/employee-post/src/main/webapp/WEB-INF/picketlink-idfed.xml
federation/trunk/picketlink-webapps/employee-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml
federation/trunk/picketlink-webapps/employee-standalone/src/main/webapp/WEB-INF/picketlink-idfed.xml
federation/trunk/picketlink-webapps/employee/src/main/webapp/WEB-INF/picketlink-idfed.xml
federation/trunk/picketlink-webapps/idp-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml
federation/trunk/picketlink-webapps/idp-standalone/src/main/webapp/WEB-INF/picketlink-idfed.xml
federation/trunk/picketlink-webapps/idp/src/main/webapp/WEB-INF/picketlink-idfed.xml
federation/trunk/picketlink-webapps/sales-post-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml
federation/trunk/picketlink-webapps/sales-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml
federation/trunk/picketlink-webapps/sales-standalone/src/main/webapp/WEB-INF/picketlink-idfed.xml
federation/trunk/picketlink-webapps/sales/src/main/webapp/WEB-INF/picketlink-idfed.xml
Log:
use sys prop friendly strings
Modified: federation/trunk/picketlink-webapps/employee/src/main/webapp/WEB-INF/picketlink-idfed.xml
===================================================================
--- federation/trunk/picketlink-webapps/employee/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:54:52 UTC (rev 802)
+++ federation/trunk/picketlink-webapps/employee/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:55:24 UTC (rev 803)
@@ -1,4 +1,4 @@
<PicketLinkSP xmlns="urn:picketlink:identity-federation:config:1.0" ServerEnvironment="tomcat">
- <IdentityURL>http://localhost:8080/idp/</IdentityURL>
- <ServiceURL>http://localhost:8080/employee/</ServiceURL>
+ <IdentityURL>${idp.url::http://localhost:8080/idp/}</IdentityURL>
+ <ServiceURL>${employee.url::http://localhost:8080/employee/}</ServiceURL>
</PicketLinkSP>
Modified: federation/trunk/picketlink-webapps/employee-post/src/main/webapp/WEB-INF/picketlink-idfed.xml
===================================================================
--- federation/trunk/picketlink-webapps/employee-post/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:54:52 UTC (rev 802)
+++ federation/trunk/picketlink-webapps/employee-post/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:55:24 UTC (rev 803)
@@ -1,4 +1,4 @@
<PicketLinkSP xmlns="urn:picketlink:identity-federation:config:1.0" ServerEnvironment="tomcat">
- <IdentityURL>http://localhost:8080/idp/</IdentityURL>
- <ServiceURL>http://localhost:8080/employee-post/</ServiceURL>
+ <IdentityURL>${idp.url::http://localhost:8080/idp/}</IdentityURL>
+ <ServiceURL>${employee-post.url::http://localhost:8080/employee-post/}</ServiceURL>
</PicketLinkSP>
Modified: federation/trunk/picketlink-webapps/employee-post-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml
===================================================================
--- federation/trunk/picketlink-webapps/employee-post-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:54:52 UTC (rev 802)
+++ federation/trunk/picketlink-webapps/employee-post-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:55:24 UTC (rev 803)
@@ -1,6 +1,6 @@
<PicketLinkSP xmlns="urn:picketlink:identity-federation:config:1.0" ServerEnvironment="tomcat">
- <IdentityURL>http://localhost:8080/idp-sig/</IdentityURL>
- <ServiceURL>http://localhost:8080/employee-post-sig/</ServiceURL>
+ <IdentityURL>${idp-sig.url::http://localhost:8080/idp-sig/}</IdentityURL>
+ <ServiceURL>${employee-post-sig.url::http://localhost:8080/employee-post-sig/}</ServiceURL>
<KeyProvider ClassName="org.picketlink.identity.federation.core.impl.KeyStoreKeyManager">
<Auth Key="KeyStoreURL" Value="/jbid_test_keystore.jks" />
<Auth Key="KeyStorePass" Value="store123" />
Modified: federation/trunk/picketlink-webapps/employee-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml
===================================================================
--- federation/trunk/picketlink-webapps/employee-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:54:52 UTC (rev 802)
+++ federation/trunk/picketlink-webapps/employee-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:55:24 UTC (rev 803)
@@ -1,6 +1,6 @@
<PicketLinkSP xmlns="urn:picketlink:identity-federation:config:1.0" ServerEnvironment="tomcat">
- <IdentityURL>http://localhost:8080/idp-sig/</IdentityURL>
- <ServiceURL>http://localhost:8080/sales-sig/</ServiceURL>
+ <IdentityURL>${idp-sig.url::http://localhost:8080/idp-sig/}</IdentityURL>
+ <ServiceURL>${sales-sig.url::http://localhost:8080/sales-sig/}</ServiceURL>
<KeyProvider ClassName="org.picketlink.identity.federation.core.impl.KeyStoreKeyManager">
<Auth Key="KeyStoreURL" Value="jbid_test_keystore.jks" />
<!-- <Auth Key="KeyStorePass" Value="store123" /> -->
Modified: federation/trunk/picketlink-webapps/employee-standalone/src/main/webapp/WEB-INF/picketlink-idfed.xml
===================================================================
--- federation/trunk/picketlink-webapps/employee-standalone/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:54:52 UTC (rev 802)
+++ federation/trunk/picketlink-webapps/employee-standalone/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:55:24 UTC (rev 803)
@@ -1,6 +1,6 @@
<PicketLinkSP xmlns="urn:picketlink:identity-federation:config:1.0" ServerEnvironment="tomcat">
- <IdentityURL>http://localhost:8080/idp-standalone/</IdentityURL>
- <ServiceURL>http://localhost:8080/employee-standalone/</ServiceURL>
+ <IdentityURL>${idp-standalone.url::http://localhost:8080/idp-standalone/}</IdentityURL>
+ <ServiceURL>${employee-standalone.url::http://localhost:8080/employee-standalone/}</ServiceURL>
<Trust>
<Domains>localhost,jboss.com,jboss.org,redhat.com</Domains>
</Trust>
Modified: federation/trunk/picketlink-webapps/idp/src/main/webapp/WEB-INF/picketlink-idfed.xml
===================================================================
--- federation/trunk/picketlink-webapps/idp/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:54:52 UTC (rev 802)
+++ federation/trunk/picketlink-webapps/idp/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:55:24 UTC (rev 803)
@@ -1,6 +1,6 @@
<PicketLinkIDP xmlns="urn:picketlink:identity-federation:config:1.0" >
-<IdentityURL>http://localhost:8080/idp/</IdentityURL>
+<IdentityURL>${idp.url::http://localhost:8080/idp/}</IdentityURL>
<Trust>
- <Domains>localhost,jboss.com,jboss.org</Domains>
+ <Domains>localhost,jboss.com,jboss.org,amazonaws.com</Domains>
</Trust>
</PicketLinkIDP>
Modified: federation/trunk/picketlink-webapps/idp-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml
===================================================================
--- federation/trunk/picketlink-webapps/idp-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:54:52 UTC (rev 802)
+++ federation/trunk/picketlink-webapps/idp-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:55:24 UTC (rev 803)
@@ -1,7 +1,7 @@
<PicketLinkIDP xmlns="urn:picketlink:identity-federation:config:1.0" >
-<IdentityURL>http://localhost:8080/idp-sig/</IdentityURL>
+<IdentityURL>${idp-sig.url::http://localhost:8080/idp-sig/}</IdentityURL>
<Trust>
- <Domains>localhost,jboss.com,jboss.org,redhat.com</Domains>
+ <Domains>localhost,jboss.com,jboss.org,redhat.com,amazonaws.com</Domains>
</Trust>
<KeyProvider ClassName="org.picketlink.identity.federation.core.impl.KeyStoreKeyManager">
<Auth Key="KeyStoreURL" Value="/jbid_test_keystore.jks" />
Modified: federation/trunk/picketlink-webapps/idp-standalone/src/main/webapp/WEB-INF/picketlink-idfed.xml
===================================================================
--- federation/trunk/picketlink-webapps/idp-standalone/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:54:52 UTC (rev 802)
+++ federation/trunk/picketlink-webapps/idp-standalone/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:55:24 UTC (rev 803)
@@ -1,6 +1,6 @@
<PicketLinkIDP xmlns="urn:picketlink:identity-federation:config:1.0"
AttributeManager="org.picketlink.identity.federation.core.impl.EmptyAttributeManager">
- <IdentityURL>http://localhost:8080/idp-standalone/</IdentityURL>
+ <IdentityURL>${idp-standalone.url::http://localhost:8080/idp-standalone/}</IdentityURL>
<Trust>
<Domains>localhost,jboss.com,jboss.org</Domains>
</Trust>
Modified: federation/trunk/picketlink-webapps/sales/src/main/webapp/WEB-INF/picketlink-idfed.xml
===================================================================
--- federation/trunk/picketlink-webapps/sales/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:54:52 UTC (rev 802)
+++ federation/trunk/picketlink-webapps/sales/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:55:24 UTC (rev 803)
@@ -1,4 +1,4 @@
<PicketLinkSP xmlns="urn:picketlink:identity-federation:config:1.0" ServerEnvironment="tomcat">
- <IdentityURL>http://localhost:8080/idp/</IdentityURL>
- <ServiceURL>http://localhost:8080/sales/</ServiceURL>
+ <IdentityURL>${idp.url::http://localhost:8080/idp/}</IdentityURL>
+ <ServiceURL>${sales.url::http://localhost:8080/sales/}</ServiceURL>
</PicketLinkSP>
Modified: federation/trunk/picketlink-webapps/sales-post-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml
===================================================================
--- federation/trunk/picketlink-webapps/sales-post-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:54:52 UTC (rev 802)
+++ federation/trunk/picketlink-webapps/sales-post-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:55:24 UTC (rev 803)
@@ -1,6 +1,6 @@
<PicketLinkSP xmlns="urn:picketlink:identity-federation:config:1.0" ServerEnvironment="tomcat">
- <IdentityURL>http://localhost:8080/idp-sig/</IdentityURL>
- <ServiceURL>http://localhost:8080/sales-post-sig/</ServiceURL>
+ <IdentityURL>${idp-sig.url::http://localhost:8080/idp-sig/}</IdentityURL>
+ <ServiceURL>${sales-post-sig.url::http://localhost:8080/sales-post-sig/}</ServiceURL>
<KeyProvider ClassName="org.picketlink.identity.federation.core.impl.KeyStoreKeyManager">
<Auth Key="KeyStoreURL" Value="/jbid_test_keystore.jks" />
<Auth Key="KeyStorePass" Value="store123" />
Modified: federation/trunk/picketlink-webapps/sales-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml
===================================================================
--- federation/trunk/picketlink-webapps/sales-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:54:52 UTC (rev 802)
+++ federation/trunk/picketlink-webapps/sales-sig/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:55:24 UTC (rev 803)
@@ -1,6 +1,6 @@
<PicketLinkSP xmlns="urn:picketlink:identity-federation:config:1.0" ServerEnvironment="tomcat">
- <IdentityURL>http://localhost:8080/idp-sig/</IdentityURL>
- <ServiceURL>http://localhost:8080/sales-sig/</ServiceURL>
+ <IdentityURL>${idp-sig.url::http://localhost:8080/idp-sig/}</IdentityURL>
+ <ServiceURL>${sales-sig.url::http://localhost:8080/sales-sig/}</ServiceURL>
<KeyProvider ClassName="org.picketlink.identity.federation.core.impl.KeyStoreKeyManager">
<Auth Key="KeyStoreURL" Value="jbid_test_keystore.jks" />
<!-- <Auth Key="KeyStorePass" Value="store123" /> -->
Modified: federation/trunk/picketlink-webapps/sales-standalone/src/main/webapp/WEB-INF/picketlink-idfed.xml
===================================================================
--- federation/trunk/picketlink-webapps/sales-standalone/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:54:52 UTC (rev 802)
+++ federation/trunk/picketlink-webapps/sales-standalone/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-03-09 18:55:24 UTC (rev 803)
@@ -1,6 +1,6 @@
<PicketLinkSP xmlns="urn:picketlink:identity-federation:config:1.0" ServerEnvironment="tomcat">
- <IdentityURL>http://localhost:8080/idp-standalone/</IdentityURL>
- <ServiceURL>http://localhost:8080/sales-standalone/</ServiceURL>
+ <IdentityURL>${idp-standalone.url::http://localhost:8080/idp-standalone/}</IdentityURL>
+ <ServiceURL>${sales-standalone.url::http://localhost:8080/sales-standalone/}</ServiceURL>
<Trust>
<Domains>localhost,jboss.com,jboss.org,redhat.com</Domains>
</Trust>
13 years, 1 month
Picketlink SVN: r802 - in federation/trunk/picketlink-webapps: employee-post/src/main/webapp and 3 other directories.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-03-09 13:54:52 -0500 (Wed, 09 Mar 2011)
New Revision: 802
Modified:
federation/trunk/picketlink-webapps/employee-post/src/main/webapp/logout.jsp
federation/trunk/picketlink-webapps/employee/src/main/webapp/logout.jsp
federation/trunk/picketlink-webapps/sales-post-sig/src/main/webapp/logout.jsp
federation/trunk/picketlink-webapps/sales-post/src/main/webapp/logout.jsp
federation/trunk/picketlink-webapps/sales/src/main/webapp/logout.jsp
Log:
remove session invalidation as it is done by authenticators
Modified: federation/trunk/picketlink-webapps/employee/src/main/webapp/logout.jsp
===================================================================
--- federation/trunk/picketlink-webapps/employee/src/main/webapp/logout.jsp 2011-03-09 11:53:59 UTC (rev 801)
+++ federation/trunk/picketlink-webapps/employee/src/main/webapp/logout.jsp 2011-03-09 18:54:52 UTC (rev 802)
@@ -1,4 +1 @@
-<%
- session.invalidate();
-%>
You are logged out.
Modified: federation/trunk/picketlink-webapps/employee-post/src/main/webapp/logout.jsp
===================================================================
--- federation/trunk/picketlink-webapps/employee-post/src/main/webapp/logout.jsp 2011-03-09 11:53:59 UTC (rev 801)
+++ federation/trunk/picketlink-webapps/employee-post/src/main/webapp/logout.jsp 2011-03-09 18:54:52 UTC (rev 802)
@@ -1,4 +1,2 @@
-<%
- session.invalidate();
-%>
+
You are logged out.
Modified: federation/trunk/picketlink-webapps/sales/src/main/webapp/logout.jsp
===================================================================
--- federation/trunk/picketlink-webapps/sales/src/main/webapp/logout.jsp 2011-03-09 11:53:59 UTC (rev 801)
+++ federation/trunk/picketlink-webapps/sales/src/main/webapp/logout.jsp 2011-03-09 18:54:52 UTC (rev 802)
@@ -1,4 +1 @@
-<%
- session.invalidate();
-%>
You are logged out.
Modified: federation/trunk/picketlink-webapps/sales-post/src/main/webapp/logout.jsp
===================================================================
--- federation/trunk/picketlink-webapps/sales-post/src/main/webapp/logout.jsp 2011-03-09 11:53:59 UTC (rev 801)
+++ federation/trunk/picketlink-webapps/sales-post/src/main/webapp/logout.jsp 2011-03-09 18:54:52 UTC (rev 802)
@@ -1,4 +1 @@
-<%
- session.invalidate();
-%>
You are logged out.
Modified: federation/trunk/picketlink-webapps/sales-post-sig/src/main/webapp/logout.jsp
===================================================================
--- federation/trunk/picketlink-webapps/sales-post-sig/src/main/webapp/logout.jsp 2011-03-09 11:53:59 UTC (rev 801)
+++ federation/trunk/picketlink-webapps/sales-post-sig/src/main/webapp/logout.jsp 2011-03-09 18:54:52 UTC (rev 802)
@@ -1,4 +1 @@
-<%
- session.invalidate();
-%>
You are logged out.
13 years, 1 month
Picketlink SVN: r801 - idm/trunk/picketlink-idm-ldap/src/test/resources/config/ldap.
by picketlink-commits@lists.jboss.org
Author: bdaw
Date: 2011-03-09 06:53:59 -0500 (Wed, 09 Mar 2011)
New Revision: 801
Modified:
idm/trunk/picketlink-idm-ldap/src/test/resources/config/ldap/ldap-config.xml
Log:
- toto
Modified: idm/trunk/picketlink-idm-ldap/src/test/resources/config/ldap/ldap-config.xml
===================================================================
--- idm/trunk/picketlink-idm-ldap/src/test/resources/config/ldap/ldap-config.xml 2011-03-09 09:22:33 UTC (rev 800)
+++ idm/trunk/picketlink-idm-ldap/src/test/resources/config/ldap/ldap-config.xml 2011-03-09 11:53:59 UTC (rev 801)
@@ -15,22 +15,10 @@
<value>password</value>
</option>
<option>
- <name>searchTimeLimit</name>
- <value>10000</value>
- </option>
- <option>
<name>createMissingContexts</name>
<value>true</value>
</option>
<option>
- <name>cache.providerClass</name>
- <value>org.picketlink.idm.impl.cache.JBossCacheIdentityStoreCacheProviderImpl</value>
- </option>
- <option>
- <name>cache.configFile</name>
- <value>jboss-cache.xml</value>
- </option>
- <option>
<name>pagedResultsExtensionSupported</name>
<value>true</value>
</option>
@@ -44,33 +32,18 @@
<attribute>
<name>phone</name>
<mapping>telephoneNumber</mapping>
- <!--<type>text</type>-->
- <!--<isRequired>false</isRequired>-->
- <!--<isMultivalued>false</isMultivalued>-->
- <!--<isReadOnly>false</isReadOnly>-->
- </attribute>
+ </attribute>
<attribute>
<name>description</name>
<mapping>description</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>true</isReadOnly>
- </attribute>
+ </attribute>
<attribute>
<name>carLicense</name>
<mapping>carLicense</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
+ </attribute>
<attribute>
<name>email</name>
<mapping>mail</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
<isReadOnly>false</isReadOnly>
<isUnique>true</isUnique>
</attribute>
@@ -104,7 +77,7 @@
<groups>
<group>
<name>FOO</name>
- <mapping></mapping>
+ <mapping>/organization/acme/foo</mapping>
<attributes/>
<options>
<option>
@@ -140,7 +113,7 @@
</group>
<group>
<name>BAR</name>
- <mapping></mapping>
+ <mapping>/organization/acme/bar</mapping>
<attributes/>
<options>
<option>
13 years, 1 month
Picketlink SVN: r800 - in idm/trunk: picketlink-idm-core/src/main/java/org/picketlink/idm/impl/configuration and 16 other directories.
by picketlink-commits@lists.jboss.org
Author: bdaw
Date: 2011-03-09 04:22:33 -0500 (Wed, 09 Mar 2011)
New Revision: 800
Added:
idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/configuration/stax/
idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/configuration/stax/ParserUtil.java
idm/trunk/picketlink-idm-core/src/test/java/org/picketlink/idm/impl/configuration/stax/
idm/trunk/picketlink-idm-core/src/test/java/org/picketlink/idm/impl/configuration/stax/ParserUtilTestCase.java
idm/trunk/picketlink-idm-core/src/test/resources/config/
idm/trunk/picketlink-idm-core/src/test/resources/config/parse-attributes.xml
idm/trunk/picketlink-idm-core/src/test/resources/config/parse-options.xml
idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/
idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/
idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/
idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPGroupMetaDataImpl.java
idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPIdentityObjectTypeMetaDataImpl.java
idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPStoreMetaDataImpl.java
idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPUserMetaDataImpl.java
idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/template/
idm/trunk/picketlink-idm-ldap/src/test/java/org/picketlink/idm/impl/configuration/
idm/trunk/picketlink-idm-ldap/src/test/java/org/picketlink/idm/impl/configuration/ldap/
idm/trunk/picketlink-idm-ldap/src/test/java/org/picketlink/idm/impl/configuration/ldap/LDAPConfigTestCase.java
idm/trunk/picketlink-idm-ldap/src/test/resources/config/
idm/trunk/picketlink-idm-ldap/src/test/resources/config/ldap/
idm/trunk/picketlink-idm-ldap/src/test/resources/config/ldap/ldap-config.xml
Modified:
idm/trunk/picketlink-idm-core/pom.xml
idm/trunk/picketlink-idm-ldap/pom.xml
Log:
- start for simpler config and stax
Modified: idm/trunk/picketlink-idm-core/pom.xml
===================================================================
--- idm/trunk/picketlink-idm-core/pom.xml 2011-03-08 22:42:15 UTC (rev 799)
+++ idm/trunk/picketlink-idm-core/pom.xml 2011-03-09 09:22:33 UTC (rev 800)
@@ -61,6 +61,11 @@
<version>3.2.76</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>staxnav</groupId>
+ <artifactId>staxnav</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ </dependency>
</dependencies>
Added: idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/configuration/stax/ParserUtil.java
===================================================================
--- idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/configuration/stax/ParserUtil.java (rev 0)
+++ idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/configuration/stax/ParserUtil.java 2011-03-09 09:22:33 UTC (rev 800)
@@ -0,0 +1,170 @@
+package org.picketlink.idm.impl.configuration.stax;
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
+ * as indicated by the @author tags. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.picketlink.idm.impl.api.attribute.IdentityObjectAttributeMetaDataImpl;
+import org.picketlink.idm.spi.configuration.metadata.IdentityObjectAttributeMetaData;
+import org.staxnav.StaxNavigator;
+
+/**
+ * Helper class for parsing common parts of different config files
+ *
+ * @author Boleslaw Dawidowicz
+ */
+public class ParserUtil
+{
+
+ /**
+ * Parse content of <options> element.
+ *
+ * <options>
+ * <option>
+ * <name></name>
+ * <value></value>
+ * <value></value>
+ * </option>
+ * ...
+ *
+ * @param nav
+ * @return
+ */
+ static Map<String, List<String>> parseOptions(StaxNavigator<String> nav)
+ {
+ Map<String, List<String>> options = new HashMap<String, List<String>>();
+
+ for (StaxNavigator<String> fork : nav.fork("option"))
+ {
+ String name = null;
+ List<String> values = new LinkedList<String>();
+
+
+ while(fork.hasNext())
+ {
+ String tag = fork.next();
+
+ if (tag.equals("name"))
+ {
+ name = fork.getContent();
+ }
+ else if (tag.equals("value"))
+ {
+ values.add(fork.getContent());
+ }
+ }
+
+ if (name != null && name.length() > 0)
+ {
+ options.put(name, values);
+ }
+ }
+
+ return options;
+ }
+
+ /**
+ * Parse content of <attributes> element.
+ * <attributes>
+ * <attribute>
+ * <name>picture</name>
+ * <mapping>user.picture</mapping>
+ * <type>binary</type>
+ * <isRequired>false</isRequired>
+ * <isMultivalued>false</isMultivalued>
+ * <isReadOnly>false</isReadOnly>
+ * </attribute>
+ * ...
+ *
+ * @param nav
+ * @return
+ */
+ static List<IdentityObjectAttributeMetaData> parseAttributes(StaxNavigator<String> nav)
+ {
+
+
+ List<IdentityObjectAttributeMetaData> attributes = new LinkedList<IdentityObjectAttributeMetaData>();
+
+ for (StaxNavigator<String> fork : nav.fork("attribute"))
+ {
+
+ // Use some good defaults
+ String name = null;
+ String mapping = null;
+ String type = "text";
+ boolean isRequired = false;
+ boolean isMultivalued = false;
+ boolean isReadOnly = false;
+ boolean isUnique = false;
+
+ while(fork.hasNext())
+ {
+ String tag = fork.next();
+
+ if (tag.equals("name"))
+ {
+ name = fork.getContent();
+ }
+ else if (tag.equals("mapping"))
+ {
+ mapping = fork.getContent();
+ }
+ else if (tag.equals("type"))
+ {
+ type = fork.getContent();
+ }
+ else if (tag.equals("isRequired"))
+ {
+ isRequired = Boolean.valueOf(fork.getContent());
+ }
+ else if (tag.equals("isMultivalued"))
+ {
+ isMultivalued = Boolean.valueOf(fork.getContent());
+ }
+ else if (tag.equals("isReadOnly"))
+ {
+ isReadOnly = Boolean.valueOf(fork.getContent());
+ }
+ else if (tag.equals("isUnique"))
+ {
+ isUnique = Boolean.valueOf(fork.getContent());
+ }
+ }
+
+ if (name != null && name.length() > 0)
+ {
+ attributes.add(new
+ IdentityObjectAttributeMetaDataImpl(name, mapping, type, isReadOnly, isMultivalued, isRequired, isUnique));
+ }
+ }
+
+ return attributes;
+ }
+
+
+ public enum Element
+ {
+ NAME, VALUE;
+ }
+
+}
Added: idm/trunk/picketlink-idm-core/src/test/java/org/picketlink/idm/impl/configuration/stax/ParserUtilTestCase.java
===================================================================
--- idm/trunk/picketlink-idm-core/src/test/java/org/picketlink/idm/impl/configuration/stax/ParserUtilTestCase.java (rev 0)
+++ idm/trunk/picketlink-idm-core/src/test/java/org/picketlink/idm/impl/configuration/stax/ParserUtilTestCase.java 2011-03-09 09:22:33 UTC (rev 800)
@@ -0,0 +1,101 @@
+package org.picketlink.idm.impl.configuration.stax;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import junit.framework.TestCase;
+import org.picketlink.idm.spi.configuration.metadata.IdentityObjectAttributeMetaData;
+import org.staxnav.Naming;
+import org.staxnav.StaxNavigatorImpl;
+
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
+ * as indicated by the @author tags. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+public class ParserUtilTestCase extends TestCase
+{
+
+ /** . */
+ private StaxNavigatorImpl<String> navigator;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+
+ }
+
+ public void testOptions() throws Exception
+ {
+ InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream("config/parse-options.xml");
+ XMLInputFactory factory = XMLInputFactory.newInstance();
+ XMLStreamReader stream = factory.createXMLStreamReader(is);
+
+ //
+ navigator = new StaxNavigatorImpl<String>(new Naming.Local(), stream);
+
+
+ assertTrue(navigator.child("options"));
+ Map<String, List<String>> options = ParserUtil.parseOptions(navigator);
+
+ assertEquals(3, options.size());
+ assertEquals(4, options.get("opt-c").size());
+
+
+
+
+ }
+
+ public void testAttributess() throws Exception
+ {
+
+ InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream("config/parse-attributes.xml");
+ XMLInputFactory factory = XMLInputFactory.newInstance();
+ XMLStreamReader stream = factory.createXMLStreamReader(is);
+
+ //
+ navigator = new StaxNavigatorImpl<String>(new Naming.Local(), stream);
+
+
+ assertTrue(navigator.child("attributes"));
+ List<IdentityObjectAttributeMetaData> attrs = ParserUtil.parseAttributes(navigator);
+
+ assertEquals(3, attrs.size());
+
+ IdentityObjectAttributeMetaData attr = attrs.get(0);
+ assertEquals("picture", attr.getName());
+ assertEquals("user.picture", attr.getStoreMapping());
+ assertEquals("binary", attr.getType());
+ assertEquals(false, attr.isReadonly());
+
+ attr = attrs.get(1);
+ assertEquals("email", attr.getName());
+ assertEquals("mail", attr.getStoreMapping());
+ assertEquals("text", attr.getType());
+ assertEquals(false, attr.isReadonly());
+
+ attr = attrs.get(2);
+ assertEquals("description", attr.getName());
+ assertEquals("description", attr.getStoreMapping());
+ assertEquals("text", attr.getType());
+ assertEquals(true, attr.isReadonly());
+
+ }
+}
Added: idm/trunk/picketlink-idm-core/src/test/resources/config/parse-attributes.xml
===================================================================
--- idm/trunk/picketlink-idm-core/src/test/resources/config/parse-attributes.xml (rev 0)
+++ idm/trunk/picketlink-idm-core/src/test/resources/config/parse-attributes.xml 2011-03-09 09:22:33 UTC (rev 800)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<config>
+ <attributes>
+ <attribute>
+ <name>picture</name>
+ <mapping>user.picture</mapping>
+ <type>binary</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ <attribute>
+ <name>email</name>
+ <mapping>mail</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ <isUnique>true</isUnique>
+ </attribute>
+ <attribute>
+ <name>description</name>
+ <mapping>description</mapping>
+ <isReadOnly>true</isReadOnly>
+ </attribute>
+ </attributes>
+</config>
\ No newline at end of file
Added: idm/trunk/picketlink-idm-core/src/test/resources/config/parse-options.xml
===================================================================
--- idm/trunk/picketlink-idm-core/src/test/resources/config/parse-options.xml (rev 0)
+++ idm/trunk/picketlink-idm-core/src/test/resources/config/parse-options.xml 2011-03-09 09:22:33 UTC (rev 800)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<config>
+ <options>
+ <option>
+ <name>opt-a</name>
+ <value>value-a</value>
+ </option>
+ <option>
+ <name>opt-b</name>
+ <value>value-a</value>
+ <value>value-b</value>
+ <value>value-c</value>
+ </option>
+ <option>
+ <name>opt-c</name>
+ <value>value-a</value>
+ <value>value-b</value>
+ <value>value-c</value>
+ <value>value-d</value>
+ </option>
+ </options>
+</config>
\ No newline at end of file
Modified: idm/trunk/picketlink-idm-ldap/pom.xml
===================================================================
--- idm/trunk/picketlink-idm-ldap/pom.xml 2011-03-08 22:42:15 UTC (rev 799)
+++ idm/trunk/picketlink-idm-ldap/pom.xml 2011-03-09 09:22:33 UTC (rev 800)
@@ -37,6 +37,12 @@
</dependency>
<dependency>
+ <groupId>staxnav</groupId>
+ <artifactId>staxnav</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit</artifactId>
<version>1.2.2</version>
Added: idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPGroupMetaDataImpl.java
===================================================================
--- idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPGroupMetaDataImpl.java (rev 0)
+++ idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPGroupMetaDataImpl.java 2011-03-09 09:22:33 UTC (rev 800)
@@ -0,0 +1,23 @@
+package org.picketlink.idm.impl.configuration.ldap.metadata;
+
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
+ * as indicated by the @author tags. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+public class LDAPGroupMetaDataImpl
+{
+}
Added: idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPIdentityObjectTypeMetaDataImpl.java
===================================================================
--- idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPIdentityObjectTypeMetaDataImpl.java (rev 0)
+++ idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPIdentityObjectTypeMetaDataImpl.java 2011-03-09 09:22:33 UTC (rev 800)
@@ -0,0 +1,23 @@
+package org.picketlink.idm.impl.configuration.ldap.metadata;
+
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
+ * as indicated by the @author tags. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+public class LDAPIdentityObjectTypeMetaDataImpl
+{
+}
Added: idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPStoreMetaDataImpl.java
===================================================================
--- idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPStoreMetaDataImpl.java (rev 0)
+++ idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPStoreMetaDataImpl.java 2011-03-09 09:22:33 UTC (rev 800)
@@ -0,0 +1,30 @@
+package org.picketlink.idm.impl.configuration.ldap.metadata;
+
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
+ * as indicated by the @author tags. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+
+/**
+ * Simple MetaData to represent LDAP Identity Store configuration
+ */
+public class LDAPStoreMetaDataImpl
+{
+
+
+}
Added: idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPUserMetaDataImpl.java
===================================================================
--- idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPUserMetaDataImpl.java (rev 0)
+++ idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/configuration/ldap/metadata/LDAPUserMetaDataImpl.java 2011-03-09 09:22:33 UTC (rev 800)
@@ -0,0 +1,23 @@
+package org.picketlink.idm.impl.configuration.ldap.metadata;
+
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
+ * as indicated by the @author tags. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+public class LDAPUserMetaDataImpl
+{
+}
Added: idm/trunk/picketlink-idm-ldap/src/test/java/org/picketlink/idm/impl/configuration/ldap/LDAPConfigTestCase.java
===================================================================
--- idm/trunk/picketlink-idm-ldap/src/test/java/org/picketlink/idm/impl/configuration/ldap/LDAPConfigTestCase.java (rev 0)
+++ idm/trunk/picketlink-idm-ldap/src/test/java/org/picketlink/idm/impl/configuration/ldap/LDAPConfigTestCase.java 2011-03-09 09:22:33 UTC (rev 800)
@@ -0,0 +1,47 @@
+package org.picketlink.idm.impl.configuration.ldap;
+
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import junit.framework.TestCase;
+import org.staxnav.Naming;
+import org.staxnav.StaxNavigatorImpl;
+
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
+ * as indicated by the @author tags. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+public class LDAPConfigTestCase extends TestCase
+{
+
+ /** . */
+ private StaxNavigatorImpl<String> navigator;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream("portlet-application.xml");
+ XMLInputFactory factory = XMLInputFactory.newInstance();
+ XMLStreamReader stream = factory.createXMLStreamReader(is);
+
+ //
+ navigator = new StaxNavigatorImpl<String>(new Naming.Local(), stream);
+ }
+
+}
Added: idm/trunk/picketlink-idm-ldap/src/test/resources/config/ldap/ldap-config.xml
===================================================================
--- idm/trunk/picketlink-idm-ldap/src/test/resources/config/ldap/ldap-config.xml (rev 0)
+++ idm/trunk/picketlink-idm-ldap/src/test/resources/config/ldap/ldap-config.xml 2011-03-09 09:22:33 UTC (rev 800)
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<stores>
+ <ldap>
+ <options>
+ <option>
+ <name>providerURL</name>
+ <value>ldap://localhost:10389</value>
+ </option>
+ <option>
+ <name>adminDN</name>
+ <value>cn=Directory Manager</value>
+ </option>
+ <option>
+ <name>adminPassword</name>
+ <value>password</value>
+ </option>
+ <option>
+ <name>searchTimeLimit</name>
+ <value>10000</value>
+ </option>
+ <option>
+ <name>createMissingContexts</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>cache.providerClass</name>
+ <value>org.picketlink.idm.impl.cache.JBossCacheIdentityStoreCacheProviderImpl</value>
+ </option>
+ <option>
+ <name>cache.configFile</name>
+ <value>jboss-cache.xml</value>
+ </option>
+ <option>
+ <name>pagedResultsExtensionSupported</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>pagedResultsExtensionSize</name>
+ <value>1</value>
+ </option>
+ </options>
+ <user>
+ <attributes>
+ <attribute>
+ <name>phone</name>
+ <mapping>telephoneNumber</mapping>
+ <!--<type>text</type>-->
+ <!--<isRequired>false</isRequired>-->
+ <!--<isMultivalued>false</isMultivalued>-->
+ <!--<isReadOnly>false</isReadOnly>-->
+ </attribute>
+ <attribute>
+ <name>description</name>
+ <mapping>description</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>true</isReadOnly>
+ </attribute>
+ <attribute>
+ <name>carLicense</name>
+ <mapping>carLicense</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ <attribute>
+ <name>email</name>
+ <mapping>mail</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ <isUnique>true</isUnique>
+ </attribute>
+ </attributes>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>uid</value>
+ </option>
+ <option>
+ <name>passwordAttributeName</name>
+ <value>userPassword</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+ <value>ou=People,o=test,o=trunk,o=idm,o=jbid,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=inetOrgPerson</value>
+ <value>sn= </value>
+ <value>cn= </value>
+ </option>
+ </options>
+ </user>
+ <groups>
+ <group>
+ <name>FOO</name>
+ <mapping></mapping>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+ <value>ou=Foo,o=test,o=trunk,o=idm,o=jbid,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>parentMembershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isParentMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </group>
+ <group>
+ <name>BAR</name>
+ <mapping></mapping>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+ <value>ou=Bar,o=test,o=trunk,o=idm,o=jbid,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>parentMembershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isParentMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </group>
+ </groups>
+ </ldap>
+</stores>
13 years, 1 month
Picketlink SVN: r799 - federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth.
by picketlink-commits@lists.jboss.org
Author: sguilhen(a)redhat.com
Date: 2011-03-08 17:42:15 -0500 (Tue, 08 Mar 2011)
New Revision: 799
Modified:
federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java
Log:
PLFED-136: SAML2STSLoginModule now accepts properties that can be used to configure the Dispatch instance that will be used to send requests to the STS.
Modified: federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java
===================================================================
--- federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java 2011-03-08 07:37:27 UTC (rev 798)
+++ federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java 2011-03-08 22:42:15 UTC (rev 799)
@@ -33,6 +33,8 @@
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.login.LoginException;
import javax.xml.datatype.XMLGregorianCalendar;
+import javax.xml.transform.Source;
+import javax.xml.ws.Dispatch;
import org.jboss.security.SecurityConstants;
import org.jboss.security.auth.callback.ObjectCallback;
@@ -64,7 +66,7 @@
* and included in the {@code Group} returned by the {@code getRoleSets} method.
* </p>
* <p>
- * This module defines module options:
+ * This module defines the following module options:
* <li>
* <ul>configFile - this property identifies the properties file that will be used to establish communication with
* the external security token service.
@@ -75,6 +77,14 @@
* if the cache.invalidation option is configured.
* </ul>
* </li>
+ * </p>
+ * <p>
+ * Any properties specified besides the above properties are assumed to be used to configure how the {@code STSClient}
+ * will connect to the STS. For example, the JBossWS {@code StubExt.PROPERTY_SOCKET_FACTORY} can be specified in order
+ * to inform the socket factory that must be used to connect to the STS. All properties will be set in the request
+ * context of the {@code Dispatch} instance used by the {@code STSClient} to send requests to the STS.
+ * </p>
+ * <p>
* An example of a {@code configFile} can be seen bellow:
* <pre>
* serviceName=PicketLinkSTS
@@ -110,6 +120,8 @@
protected String securityDomain = null;
+ protected Map<String, ?> options = null;
+
/*
* (non-Javadoc)
* @see org.jboss.security.auth.spi.AbstractServerLoginModule#initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map)
@@ -119,18 +131,19 @@
Map<String, ?> options)
{
super.initialize(subject, callbackHandler, sharedState, options);
- // check if the options contain the name of the STS configuration file.
- this.stsConfigurationFile = (String) options.get("configFile");
-
- String cacheInvalidation = (String) options.get( "cache.invalidation" );
+ this.options = options;
+
+ // save the config file and cache validation options, removing them from the map - all remainig properties will
+ // be set in the request context of the Dispatch instance used to send requests to the STS.
+ this.stsConfigurationFile = (String) this.options.remove("configFile");
+ String cacheInvalidation = (String) this.options.remove( "cache.invalidation" );
if( cacheInvalidation != null && !cacheInvalidation.isEmpty() )
{
- enableCacheInvalidation = Boolean.parseBoolean( cacheInvalidation );
- securityDomain = (String) options.get( SecurityConstants.SECURITY_DOMAIN_OPTION );
- if( securityDomain == null || securityDomain.isEmpty() )
+ this.enableCacheInvalidation = Boolean.parseBoolean( cacheInvalidation );
+ this.securityDomain = (String) this.options.remove( SecurityConstants.SECURITY_DOMAIN_OPTION );
+ if( this.securityDomain == null || this.securityDomain.isEmpty() )
throw new RuntimeException( "Please configure option:" + SecurityConstants.SECURITY_DOMAIN_OPTION );
}
-
}
/*
@@ -339,6 +352,15 @@
protected STSClient getSTSClient()
{
Builder builder = new Builder(this.stsConfigurationFile);
- return new STSClient(builder.build());
+ STSClient client = new STSClient(builder.build());
+ // if the login module options map still contains any properties, assume they are for configuring the connection
+ // to the STS and set them in the Dispatch request context.
+ if (!this.options.isEmpty())
+ {
+ Dispatch<Source> dispatch = client.getDispatch();
+ for (Map.Entry<String, ?> entry : this.options.entrySet())
+ dispatch.getRequestContext().put(entry.getKey(), entry.getValue());
+ }
+ return client;
}
}
\ No newline at end of file
13 years, 1 month