Author: anil.saldhana(a)jboss.com
Date: 2010-12-30 11:49:15 -0500 (Thu, 30 Dec 2010)
New Revision: 621
Removed:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/NetworkUtil.java
Modified:
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/response/SAML2Response.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLAuthNRequestParser.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLConditionsParser.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLRequestAbstractParser.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLStatusResponseTypeParser.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/util/SAMLParserUtil.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/MetaDataBuilderDelegate.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/JBossSAMLAuthnRequestFactory.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/SAMLAssertionFactory.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/sts/STSCoreConfig.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTSConfiguration.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2LogOutHandler.java
Log:
get rid of the redundant NetworkUtil class
Modified:
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/response/SAML2Response.java
===================================================================
---
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/response/SAML2Response.java 2010-12-28
20:18:36 UTC (rev 620)
+++
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/response/SAML2Response.java 2010-12-30
16:49:15 UTC (rev 621)
@@ -29,6 +29,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Writer;
+import java.net.URI;
import java.util.Arrays;
import javax.xml.bind.JAXBException;
@@ -49,8 +50,7 @@
import org.picketlink.identity.federation.core.saml.v2.holders.SPInfoHolder;
import org.picketlink.identity.federation.core.saml.v2.util.AssertionUtil;
import org.picketlink.identity.federation.core.saml.v2.util.DocumentUtil;
-import org.picketlink.identity.federation.core.saml.v2.writers.SAMLResponseWriter;
-import org.picketlink.identity.federation.core.util.NetworkUtil;
+import org.picketlink.identity.federation.core.saml.v2.writers.SAMLResponseWriter;
import org.picketlink.identity.federation.core.util.StaxUtil;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.ActionType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AssertionType;
@@ -100,7 +100,7 @@
AuthnStatementType authnStatement = new AuthnStatementType( issueInstant );
AuthnContextType act = new AuthnContextType();
String authContextDeclRef =
JBossSAMLURIConstants.AC_PASSWORD_PROTECTED_TRANSPORT.get();
- act.addAuthenticatingAuthority( NetworkUtil.createURI( authContextDeclRef ));
+ act.addAuthenticatingAuthority( URI.create( authContextDeclRef ));
authnStatement.setAuthnContext(act);
return authnStatement;
}
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLAuthNRequestParser.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLAuthNRequestParser.java 2010-12-28
20:18:36 UTC (rev 620)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLAuthNRequestParser.java 2010-12-30
16:49:15 UTC (rev 621)
@@ -21,6 +21,8 @@
*/
package org.picketlink.identity.federation.core.parsers.saml;
+import java.net.URI;
+
import javax.xml.namespace.QName;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.events.Attribute;
@@ -30,8 +32,7 @@
import org.picketlink.identity.federation.core.parsers.ParserNamespaceSupport;
import org.picketlink.identity.federation.core.parsers.util.StaxParserUtil;
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
-import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLURIConstants;
-import org.picketlink.identity.federation.core.util.NetworkUtil;
+import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLURIConstants;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.ConditionsType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.SubjectType;
import org.picketlink.identity.federation.newmodel.saml.v2.protocol.AuthnRequestType;
@@ -121,7 +122,7 @@
if( assertionConsumerServiceURL != null )
{
String uri = StaxParserUtil.getAttributeValue( assertionConsumerServiceURL );
- authnRequest.setAssertionConsumerServiceURL( NetworkUtil.createURI(uri));
+ authnRequest.setAssertionConsumerServiceURL( URI.create(uri));
}
@@ -131,7 +132,7 @@
Attribute protocolBinding = startElement.getAttributeByName( new QName(
"ProtocolBinding" ));
if( protocolBinding != null )
- authnRequest.setProtocolBinding( NetworkUtil.createURI(
StaxParserUtil.getAttributeValue( protocolBinding )));
+ authnRequest.setProtocolBinding( URI.create( StaxParserUtil.getAttributeValue(
protocolBinding )));
Attribute providerName = startElement.getAttributeByName( new QName(
"ProviderName" ));
if( providerName != null )
@@ -166,7 +167,7 @@
NameIDPolicyType nameIDPolicy = new NameIDPolicyType();
Attribute format = startElement.getAttributeByName( new QName( "Format"
));
if( format != null )
- nameIDPolicy.setFormat( NetworkUtil.createURI( StaxParserUtil.getAttributeValue(
format )));
+ nameIDPolicy.setFormat( URI.create( StaxParserUtil.getAttributeValue( format
)));
Attribute allowCreate = startElement.getAttributeByName( new QName(
"AllowCreate" ));
if( allowCreate != null )
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLConditionsParser.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLConditionsParser.java 2010-12-28
20:18:36 UTC (rev 620)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLConditionsParser.java 2010-12-30
16:49:15 UTC (rev 621)
@@ -21,6 +21,8 @@
*/
package org.picketlink.identity.federation.core.parsers.saml;
+import java.net.URI;
+
import javax.xml.namespace.QName;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.events.Attribute;
@@ -33,8 +35,7 @@
import org.picketlink.identity.federation.core.parsers.util.StaxParserUtil;
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLURIConstants;
-import org.picketlink.identity.federation.core.saml.v2.util.XMLTimeUtil;
-import org.picketlink.identity.federation.core.util.NetworkUtil;
+import org.picketlink.identity.federation.core.saml.v2.util.XMLTimeUtil;
import
org.picketlink.identity.federation.newmodel.saml.v2.assertion.AudienceRestrictionType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.ConditionsType;
@@ -158,7 +159,7 @@
throw new ParsingException( "audienceValue is expected ahead" );
String audienceValue = StaxParserUtil.getElementText( xmlEventReader );
- audience.addAudience( NetworkUtil.createURI( audienceValue ));
+ audience.addAudience( URI.create( audienceValue ));
XMLEvent xmlEvent = StaxParserUtil.peek(xmlEventReader);
if( xmlEvent instanceof EndElement )
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLRequestAbstractParser.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLRequestAbstractParser.java 2010-12-28
20:18:36 UTC (rev 620)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLRequestAbstractParser.java 2010-12-30
16:49:15 UTC (rev 621)
@@ -21,6 +21,8 @@
*/
package org.picketlink.identity.federation.core.parsers.saml;
+import java.net.URI;
+
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLEventReader;
@@ -30,8 +32,7 @@
import org.picketlink.identity.federation.core.exceptions.ParsingException;
import org.picketlink.identity.federation.core.parsers.util.StaxParserUtil;
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
-import org.picketlink.identity.federation.core.saml.v2.util.XMLTimeUtil;
-import org.picketlink.identity.federation.core.util.NetworkUtil;
+import org.picketlink.identity.federation.core.saml.v2.util.XMLTimeUtil;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.NameIDType;
import org.picketlink.identity.federation.newmodel.saml.v2.protocol.RequestAbstractType;
@@ -75,7 +76,7 @@
{
Attribute destinationAttr = startElement.getAttributeByName( new QName(
"Destination" ));
if( destinationAttr != null )
- request.setDestination( NetworkUtil.createURI( StaxParserUtil.getAttributeValue(
destinationAttr ) ));
+ request.setDestination( URI.create( StaxParserUtil.getAttributeValue(
destinationAttr ) ));
Attribute consent = startElement.getAttributeByName( new QName( "Consent"
));
if( consent != null )
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLStatusResponseTypeParser.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLStatusResponseTypeParser.java 2010-12-28
20:18:36 UTC (rev 620)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLStatusResponseTypeParser.java 2010-12-30
16:49:15 UTC (rev 621)
@@ -21,6 +21,8 @@
*/
package org.picketlink.identity.federation.core.parsers.saml;
+import java.net.URI;
+
import javax.xml.namespace.QName;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.events.Attribute;
@@ -31,8 +33,7 @@
import org.picketlink.identity.federation.core.exceptions.ParsingException;
import org.picketlink.identity.federation.core.parsers.util.StaxParserUtil;
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
-import org.picketlink.identity.federation.core.saml.v2.util.XMLTimeUtil;
-import org.picketlink.identity.federation.core.util.NetworkUtil;
+import org.picketlink.identity.federation.core.saml.v2.util.XMLTimeUtil;
import org.picketlink.identity.federation.newmodel.saml.v2.protocol.StatusCodeType;
import org.picketlink.identity.federation.newmodel.saml.v2.protocol.StatusResponseType;
import org.picketlink.identity.federation.newmodel.saml.v2.protocol.StatusType;
@@ -115,7 +116,7 @@
Attribute valueAttr = startElement.getAttributeByName( new QName(
"Value" ));
if( valueAttr != null )
{
- statusCode.setValue( NetworkUtil.createURI(
StaxParserUtil.getAttributeValue( valueAttr ) ));
+ statusCode.setValue( URI.create( StaxParserUtil.getAttributeValue(
valueAttr ) ));
}
status.setStatusCode( statusCode );
@@ -128,7 +129,7 @@
Attribute subValueAttr = startElement.getAttributeByName( new QName(
"Value" ));
if( subValueAttr != null )
{
- subStatusCodeType.setValue( NetworkUtil.createURI(
StaxParserUtil.getAttributeValue( subValueAttr )));
+ subStatusCodeType.setValue( URI.create(
StaxParserUtil.getAttributeValue( subValueAttr )));
}
statusCode.setStatusCode( subStatusCodeType );
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java 2010-12-28
20:18:36 UTC (rev 620)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java 2010-12-30
16:49:15 UTC (rev 621)
@@ -21,6 +21,7 @@
*/
package org.picketlink.identity.federation.core.parsers.saml.metadata;
+import java.net.URI;
import java.util.List;
import javax.xml.namespace.QName;
@@ -35,8 +36,7 @@
import org.picketlink.identity.federation.core.parsers.util.SAMLParserUtil;
import org.picketlink.identity.federation.core.parsers.util.StaxParserUtil;
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
-import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLURIConstants;
-import org.picketlink.identity.federation.core.util.NetworkUtil;
+import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLURIConstants;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeType;
import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.AttributeAuthorityDescriptorType;
import org.picketlink.identity.federation.newmodel.saml.v2.metadata.EndpointType;
@@ -155,8 +155,8 @@
Attribute locationAttr = startElement.getAttributeByName( new QName(
JBossSAMLConstants.LOCATION.get() ) );
String location = StaxParserUtil.getAttributeValue( locationAttr );
- IndexedEndpointType endpoint = new IndexedEndpointType(
NetworkUtil.createURI( binding ),
- NetworkUtil.createURI( location ));
+ IndexedEndpointType endpoint = new IndexedEndpointType( URI.create( binding
),
+ URI.create( location ));
Attribute isDefault = startElement.getAttributeByName( new QName(
JBossSAMLConstants.ISDEFAULT.get() ));
if( isDefault != null )
{
@@ -217,12 +217,12 @@
Attribute locationAttr = startElement.getAttributeByName( new QName(
JBossSAMLConstants.LOCATION.get() ) );
String location = StaxParserUtil.getAttributeValue( locationAttr );
- EndpointType endpoint = new IndexedEndpointType( NetworkUtil.createURI( binding ),
- NetworkUtil.createURI( location ));
+ EndpointType endpoint = new IndexedEndpointType( URI.create( binding ),
+ URI.create( location ));
Attribute responseLocation = startElement.getAttributeByName( new QName(
JBossSAMLConstants.RESPONSE_LOCATION.get() ));
if( responseLocation != null )
{
- endpoint.setResponseLocation( NetworkUtil.createURI(
StaxParserUtil.getAttributeValue( responseLocation )));
+ endpoint.setResponseLocation( URI.create( StaxParserUtil.getAttributeValue(
responseLocation )));
}
return endpoint;
}
@@ -256,8 +256,8 @@
Attribute locationAttr = startElement.getAttributeByName( new QName(
JBossSAMLConstants.LOCATION.get() ) );
String location = StaxParserUtil.getAttributeValue( locationAttr );
- IndexedEndpointType endpoint = new IndexedEndpointType(
NetworkUtil.createURI( binding ),
- NetworkUtil.createURI( location ));
+ IndexedEndpointType endpoint = new IndexedEndpointType( URI.create( binding
),
+ URI.create( location ));
EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
StaxParserUtil.validate( endElement,
JBossSAMLConstants.ATTRIBUTE_SERVICE.get() );
@@ -327,7 +327,7 @@
Attribute lang = startElement.getAttributeByName( new QName(
JBossSAMLURIConstants.XML.get(), "lang" ));
String langVal = StaxParserUtil.getAttributeValue(lang);
LocalizedURIType localName = new LocalizedURIType( langVal );
- localName.setValue( NetworkUtil.createURI( StaxParserUtil.getElementText(
xmlEventReader )));
+ localName.setValue( URI.create( StaxParserUtil.getElementText( xmlEventReader
)));
org.addOrganizationURL( localName ) ;
}
else
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/util/SAMLParserUtil.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/util/SAMLParserUtil.java 2010-12-28
20:18:36 UTC (rev 620)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/util/SAMLParserUtil.java 2010-12-30
16:49:15 UTC (rev 621)
@@ -21,6 +21,7 @@
*/
package org.picketlink.identity.federation.core.parsers.util;
+import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
@@ -36,8 +37,7 @@
import org.picketlink.identity.federation.core.exceptions.ParsingException;
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLURIConstants;
-import org.picketlink.identity.federation.core.saml.v2.util.XMLTimeUtil;
-import org.picketlink.identity.federation.core.util.NetworkUtil;
+import org.picketlink.identity.federation.core.saml.v2.util.XMLTimeUtil;
import org.picketlink.identity.federation.core.util.StringUtil;
import
org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeStatementType;
import
org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeStatementType.ASTChoiceType;
@@ -242,7 +242,7 @@
{
String text = StaxParserUtil.getElementText( xmlEventReader );
- AuthnContextDeclRefType aAuthnContextDeclType = new AuthnContextDeclRefType(
NetworkUtil.createURI(text));
+ AuthnContextDeclRefType aAuthnContextDeclType = new AuthnContextDeclRefType(
URI.create(text));
authnContextType.addURIType(aAuthnContextDeclType);
EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
StaxParserUtil.validate(endElement, JBossSAMLConstants.AUTHN_CONTEXT.get() );
@@ -251,7 +251,7 @@
{
String text = StaxParserUtil.getElementText( xmlEventReader );
- AuthnContextClassRefType aAuthnContextClassRefType = new
AuthnContextClassRefType( NetworkUtil.createURI(text));
+ AuthnContextClassRefType aAuthnContextClassRefType = new
AuthnContextClassRefType( URI.create(text));
authnContextType.addURIType( aAuthnContextClassRefType );
EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
StaxParserUtil.validate(endElement, JBossSAMLConstants.AUTHN_CONTEXT.get() );
@@ -282,7 +282,7 @@
Attribute format = nameIDElement.getAttributeByName( new QName(
JBossSAMLConstants.FORMAT.get() ));
if( format != null )
{
- nameID.setFormat( NetworkUtil.createURI( StaxParserUtil.getAttributeValue(
format )) );
+ nameID.setFormat( URI.create( StaxParserUtil.getAttributeValue( format )) );
}
Attribute spProvidedID = nameIDElement.getAttributeByName( new QName(
JBossSAMLConstants.SP_PROVIDED_ID.get() ));
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/MetaDataBuilderDelegate.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/MetaDataBuilderDelegate.java 2010-12-28
20:18:36 UTC (rev 620)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/MetaDataBuilderDelegate.java 2010-12-30
16:49:15 UTC (rev 621)
@@ -21,11 +21,11 @@
*/
package org.picketlink.identity.federation.core.saml.md.providers;
+import java.net.URI;
import java.util.ArrayList;
import java.util.List;
-import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
-import org.picketlink.identity.federation.core.util.NetworkUtil;
+import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeType;
import org.picketlink.identity.federation.newmodel.saml.v2.metadata.EndpointType;
import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType;
@@ -56,9 +56,9 @@
public static EndpointType createEndpoint(String binding, String location,
String responseLocation)
{
- EndpointType endpoint = new EndpointType( NetworkUtil.createURI(binding),
- NetworkUtil.createURI(location));
- endpoint.setResponseLocation( NetworkUtil.createURI( responseLocation ));
+ EndpointType endpoint = new EndpointType( URI.create(binding),
+ URI.create(location));
+ endpoint.setResponseLocation( URI.create( responseLocation ));
return endpoint;
}
@@ -92,7 +92,7 @@
//orgURL
LocalizedURIType orgURL = new LocalizedURIType( lang );
- orgURL.setValue( NetworkUtil.createURI( organizationURL ));
+ orgURL.setValue( URI.create( organizationURL ));
OrganizationType orgType = new OrganizationType();
orgType.addOrganizationName( orgName );
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/JBossSAMLAuthnRequestFactory.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/JBossSAMLAuthnRequestFactory.java 2010-12-28
20:18:36 UTC (rev 620)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/JBossSAMLAuthnRequestFactory.java 2010-12-30
16:49:15 UTC (rev 621)
@@ -21,6 +21,8 @@
*/
package org.picketlink.identity.federation.core.saml.v2.factories;
+import java.net.URI;
+
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
@@ -29,8 +31,7 @@
import org.picketlink.identity.federation.core.exceptions.ConfigurationException;
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
import org.picketlink.identity.federation.core.saml.v2.util.XMLTimeUtil;
-import org.picketlink.identity.federation.core.util.JAXBUtil;
-import org.picketlink.identity.federation.core.util.NetworkUtil;
+import org.picketlink.identity.federation.core.util.JAXBUtil;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.NameIDType;
import org.picketlink.identity.federation.newmodel.saml.v2.protocol.AuthnRequestType;
import org.xml.sax.SAXException;
@@ -60,11 +61,11 @@
String version = JBossSAMLConstants.VERSION_2_0.get();
AuthnRequestType authnRequest = new AuthnRequestType( id, version, issueInstant );
- authnRequest.setAssertionConsumerServiceURL( NetworkUtil.createURI(
assertionConsumerURL ));
- authnRequest.setProtocolBinding( NetworkUtil.createURI(
JBossSAMLConstants.HTTP_POST_BINDING.get() ));
+ authnRequest.setAssertionConsumerServiceURL( URI.create( assertionConsumerURL ));
+ authnRequest.setProtocolBinding( URI.create(
JBossSAMLConstants.HTTP_POST_BINDING.get() ));
if( destination != null )
{
- authnRequest.setDestination( NetworkUtil.createURI( destination ));
+ authnRequest.setDestination( URI.create( destination ));
}
//Create an issuer
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java 2010-12-28
20:18:36 UTC (rev 620)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java 2010-12-30
16:49:15 UTC (rev 621)
@@ -21,6 +21,7 @@
*/
package org.picketlink.identity.federation.core.saml.v2.factories;
+import java.net.URI;
import java.util.List;
import javax.xml.bind.JAXBException;
@@ -29,12 +30,12 @@
import javax.xml.datatype.XMLGregorianCalendar;
import org.picketlink.identity.federation.core.exceptions.ConfigurationException;
+import org.picketlink.identity.federation.core.saml.v2.common.IDGenerator;
import org.picketlink.identity.federation.core.saml.v2.holders.IDPInfoHolder;
import org.picketlink.identity.federation.core.saml.v2.holders.IssuerInfoHolder;
import org.picketlink.identity.federation.core.saml.v2.holders.SPInfoHolder;
import org.picketlink.identity.federation.core.saml.v2.util.XMLTimeUtil;
-import org.picketlink.identity.federation.core.util.JAXBUtil;
-import org.picketlink.identity.federation.core.util.NetworkUtil;
+import org.picketlink.identity.federation.core.util.JAXBUtil;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AssertionType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.ConditionsType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.NameIDType;
@@ -66,7 +67,7 @@
public static StatusType createStatusType(String statusCodeURI)
{
StatusCodeType sct = new StatusCodeType();
- sct.setValue( NetworkUtil.createURI( statusCodeURI ));
+ sct.setValue( URI.create( statusCodeURI ));
StatusType statusType = new StatusType();
statusType.setStatusCode(sct);
@@ -99,14 +100,14 @@
XMLGregorianCalendar issueInstant = XMLTimeUtil.getIssueInstant();
//Create an assertion
- String id = "ID_" + JBossSAMLBaseFactory.createUUID();
+ String id = IDGenerator.create( "ID_" );
//Create assertion -> subject
SubjectType subjectType = new SubjectType();
//subject -> nameid
NameIDType nameIDType = new NameIDType();
- nameIDType.setFormat( NetworkUtil.createURI( idp.getNameIDFormat() ));
+ nameIDType.setFormat( URI.create( idp.getNameIDFormat() ));
nameIDType.setValue(idp.getNameIDFormatValue());
SubjectType.STSubType subType = new SubjectType.STSubType();
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/SAMLAssertionFactory.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/SAMLAssertionFactory.java 2010-12-28
20:18:36 UTC (rev 620)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/SAMLAssertionFactory.java 2010-12-30
16:49:15 UTC (rev 621)
@@ -21,12 +21,12 @@
*/
package org.picketlink.identity.federation.core.saml.v2.factories;
+import java.net.URI;
import java.util.List;
import javax.xml.datatype.XMLGregorianCalendar;
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
-import org.picketlink.identity.federation.core.util.NetworkUtil;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AssertionType;
import
org.picketlink.identity.federation.newmodel.saml.v2.assertion.AudienceRestrictionType;
import
org.picketlink.identity.federation.newmodel.saml.v2.assertion.ConditionAbstractType;
@@ -61,7 +61,7 @@
{
for( String val: values )
{
- audienceRestriction.addAudience( NetworkUtil.createURI( val ) );
+ audienceRestriction.addAudience( URI.create( val ) );
}
}
return audienceRestriction;
@@ -81,7 +81,7 @@
{
NameIDType nameID = new NameIDType();
if( format != null )
- nameID.setFormat( NetworkUtil.createURI( format ));
+ nameID.setFormat( URI.create( format ));
nameID.setNameQualifier(qualifier);
nameID.setValue(value);
return nameID;
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/sts/STSCoreConfig.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/sts/STSCoreConfig.java 2010-12-28
20:18:36 UTC (rev 620)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/sts/STSCoreConfig.java 2010-12-30
16:49:15 UTC (rev 621)
@@ -153,4 +153,11 @@
* @return the {@code Certificate} obtained from the keystore, or {@code null} if no
certificate was found.
*/
public Certificate getCertificate(String alias);
+
+ /**
+ * Allows you to add a token provider to handle a particular namespace
+ * @param str
+ * @param provider
+ */
+ public void addTokenProvider( String str, SecurityTokenProvider provider );
}
\ No newline at end of file
Deleted:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/NetworkUtil.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/NetworkUtil.java 2010-12-28
20:18:36 UTC (rev 620)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/NetworkUtil.java 2010-12-30
16:49:15 UTC (rev 621)
@@ -1,53 +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.federation.core.util;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-/**
- * General utility class for network related stuff
- * @author Anil.Saldhana(a)redhat.com
- * @since Nov 29, 2010
- */
-public class NetworkUtil
-{
- /**
- * Create {@code URI}
- * @param value
- * @return
- */
- public static URI createURI( String value )
- {
- if( value == null )
- throw new IllegalArgumentException( "value is null" );
-
- try
- {
- return new URI( value );
- }
- catch (URISyntaxException e)
- {
- throw new RuntimeException( "value is not of type URI:", e );
- }
- }
-}
\ No newline at end of file
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTSConfiguration.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTSConfiguration.java 2010-12-28
20:18:36 UTC (rev 620)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTSConfiguration.java 2010-12-30
16:49:15 UTC (rev 621)
@@ -380,4 +380,12 @@
{
return delegate.getCanonicalizationMethod();
}
+
+ /**
+ * @see {@code STSCoreConfig#addTokenProvider(String, SecurityTokenProvider)}
+ */
+ public void addTokenProvider(String key, SecurityTokenProvider provider)
+ {
+ tokenProviders.put(key, provider);
+ }
}
\ No newline at end of file
Modified:
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2LogOutHandler.java
===================================================================
---
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2LogOutHandler.java 2010-12-28
20:18:36 UTC (rev 620)
+++
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2LogOutHandler.java 2010-12-30
16:49:15 UTC (rev 621)
@@ -21,6 +21,8 @@
*/
package org.picketlink.identity.federation.web.handlers.saml2;
+import java.net.URI;
+
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@@ -39,8 +41,7 @@
import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerRequest;
import
org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerRequest.GENERATE_REQUEST_TYPE;
import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerResponse;
-import org.picketlink.identity.federation.core.saml.v2.util.XMLTimeUtil;
-import org.picketlink.identity.federation.core.util.NetworkUtil;
+import org.picketlink.identity.federation.core.saml.v2.util.XMLTimeUtil;
import org.picketlink.identity.federation.newmodel.saml.v2.protocol.LogoutRequestType;
import org.picketlink.identity.federation.newmodel.saml.v2.protocol.ResponseType;
import org.picketlink.identity.federation.newmodel.saml.v2.protocol.StatusCodeType;
@@ -284,7 +285,7 @@
long assertionValidity = (Long)
request.getOptions().get(GeneralConstants.ASSERTIONS_VALIDITY);
lort.setNotOnOrAfter(XMLTimeUtil.add(lort.getIssueInstant(),
assertionValidity));
- lort.setDestination( NetworkUtil.createURI( participant ));
+ lort.setDestination( URI.create( participant ));
response.setResultingDocument(saml2Request.convert(lort));
response.setSendRequest(true);
@@ -330,11 +331,11 @@
//Status
StatusType statusType = new StatusType();
StatusCodeType statusCodeType = new StatusCodeType();
- statusCodeType.setValue( NetworkUtil.createURI(
JBossSAMLURIConstants.STATUS_RESPONDER.get() ));
+ statusCodeType.setValue( URI.create(
JBossSAMLURIConstants.STATUS_RESPONDER.get() ));
//2nd level status code
StatusCodeType status2ndLevel = new StatusCodeType();
- status2ndLevel.setValue( NetworkUtil.createURI(
JBossSAMLURIConstants.STATUS_SUCCESS.get() ));
+ status2ndLevel.setValue( URI.create( JBossSAMLURIConstants.STATUS_SUCCESS.get()
));
statusCodeType.setStatusCode(status2ndLevel);
statusType.setStatusCode(statusCodeType);
@@ -447,11 +448,11 @@
//Status
StatusType statusType = new StatusType();
StatusCodeType statusCodeType = new StatusCodeType();
- statusCodeType.setValue( NetworkUtil.createURI(
JBossSAMLURIConstants.STATUS_RESPONDER.get() ));
+ statusCodeType.setValue( URI.create(
JBossSAMLURIConstants.STATUS_RESPONDER.get() ));
//2nd level status code
StatusCodeType status2ndLevel = new StatusCodeType();
- status2ndLevel.setValue( NetworkUtil.createURI(
JBossSAMLURIConstants.STATUS_SUCCESS.get() ));
+ status2ndLevel.setValue( URI.create( JBossSAMLURIConstants.STATUS_SUCCESS.get()
));
statusCodeType.setStatusCode(status2ndLevel);
statusType.setStatusCode(statusCodeType);