Class SamlProfileSamlNameIdBuilder
- java.lang.Object
-
- org.apereo.cas.support.saml.util.AbstractSamlObjectBuilder
-
- org.apereo.cas.support.saml.util.AbstractSaml20ObjectBuilder
-
- org.apereo.cas.support.saml.web.idp.profile.builders.nameid.SamlProfileSamlNameIdBuilder
-
- All Implemented Interfaces:
java.io.Serializable,SamlProfileObjectBuilder<org.opensaml.saml.saml2.core.NameID>
public class SamlProfileSamlNameIdBuilder extends org.apereo.cas.support.saml.util.AbstractSaml20ObjectBuilder implements SamlProfileObjectBuilder<org.opensaml.saml.saml2.core.NameID>
This isSamlProfileSamlNameIdBuilder.- Since:
- 5.0.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SamlProfileSamlNameIdBuilder(org.apereo.cas.support.saml.OpenSamlConfigBean configBean, org.apereo.cas.authentication.principal.PersistentIdGenerator persistentIdGenerator, SamlIdPObjectEncrypter samlObjectEncrypter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.opensaml.saml.saml2.core.NameIDbuild(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object assertion, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor, java.lang.String binding, org.opensaml.messaging.context.MessageContext messageContext)Build response.protected org.opensaml.saml.saml2.core.NameIDdetermineNameId(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, java.lang.Object assertion, java.util.List<java.lang.String> supportedNameFormats, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)Determine name id name id.protected org.opensaml.saml.saml2.core.NameIDencodeNameIdBasedOnNameFormat(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, java.lang.Object assertion, java.lang.String nameFormat, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)Encode name id based on name format name id.protected org.opensaml.saml.saml2.core.NameIDfinalizeNameId(org.opensaml.saml.saml2.core.NameID nameid, org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, java.lang.Object assertion, java.util.List<java.lang.String> supportedNameFormats, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)Finalize name id name id.protected static java.lang.StringgetRequiredNameIdFormatIfAny(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest)Gets required name id format if any.protected static java.util.List<java.lang.String>getSupportedNameIdFormats(org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)Gets supported name id formats.protected net.shibboleth.idp.attribute.IdPAttributeprepareNameIdAttribute(java.lang.Object casAssertion, java.lang.String nameFormat, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor, org.apereo.cas.support.saml.services.SamlRegisteredService registeredService)Prepare name id attribute id p attribute.protected static net.shibboleth.idp.saml.attribute.encoding.impl.SAML2StringNameIDEncoderprepareNameIdEncoder(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, java.lang.String nameFormat, net.shibboleth.idp.attribute.IdPAttribute attribute, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)Prepare name id encoder saml 2 string name id encoder.protected voidvalidateRequiredNameIdFormatIfAny(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor, java.util.List<java.lang.String> supportedNameFormats, java.lang.String requiredNameFormat)Validate required name id format if any.-
Methods inherited from class org.apereo.cas.support.saml.util.AbstractSaml20ObjectBuilder
addAttributeValuesToSaml2Attribute, decodeSamlAuthnRequest, generateSecureRandomId, getNameID, inflateAuthnRequest, newAssertion, newAssertion, newAttribute, newAttributeStatement, newAttributeStatement, newAuthnStatement, newConditions, newEcpResponse, newIssuer, newLogoutRequest, newResponse, newStatus, newSubject, newSubject
-
-
-
-
Constructor Detail
-
SamlProfileSamlNameIdBuilder
public SamlProfileSamlNameIdBuilder(org.apereo.cas.support.saml.OpenSamlConfigBean configBean, org.apereo.cas.authentication.principal.PersistentIdGenerator persistentIdGenerator, SamlIdPObjectEncrypter samlObjectEncrypter)
-
-
Method Detail
-
getSupportedNameIdFormats
protected static java.util.List<java.lang.String> getSupportedNameIdFormats(org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)Gets supported name id formats.- Parameters:
service- the serviceadaptor- the adaptor- Returns:
- the supported name id formats
-
build
public org.opensaml.saml.saml2.core.NameID build(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object assertion, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor, java.lang.String binding, org.opensaml.messaging.context.MessageContext messageContext) throws org.apereo.cas.support.saml.SamlExceptionDescription copied from interface:SamlProfileObjectBuilderBuild response.- Specified by:
buildin interfaceSamlProfileObjectBuilder<org.opensaml.saml.saml2.core.NameID>- Parameters:
authnRequest- the authn requestrequest- the requestresponse- the responseassertion- the assertionservice- the serviceadaptor- the adaptorbinding- the bindingmessageContext- the message context- Returns:
- the response
- Throws:
org.apereo.cas.support.saml.SamlException- the exception
-
finalizeNameId
protected org.opensaml.saml.saml2.core.NameID finalizeNameId(org.opensaml.saml.saml2.core.NameID nameid, org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, java.lang.Object assertion, java.util.List<java.lang.String> supportedNameFormats, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)Finalize name id name id.- Parameters:
nameid- the nameidauthnRequest- the authn requestassertion- the assertionsupportedNameFormats- the supported name formatsservice- the serviceadaptor- the adaptor- Returns:
- the name id
-
validateRequiredNameIdFormatIfAny
protected void validateRequiredNameIdFormatIfAny(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor, java.util.List<java.lang.String> supportedNameFormats, java.lang.String requiredNameFormat)Validate required name id format if any.- Parameters:
authnRequest- the authn requestadaptor- the adaptorsupportedNameFormats- the supported name formatsrequiredNameFormat- the required name format
-
getRequiredNameIdFormatIfAny
protected static java.lang.String getRequiredNameIdFormatIfAny(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest)
Gets required name id format if any.- Parameters:
authnRequest- the authn request- Returns:
- the required name id format if any
-
determineNameId
protected org.opensaml.saml.saml2.core.NameID determineNameId(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, java.lang.Object assertion, java.util.List<java.lang.String> supportedNameFormats, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)Determine name id name id.- Parameters:
authnRequest- the authn requestassertion- the assertionsupportedNameFormats- the supported name formatsservice- the serviceadaptor- the adaptor- Returns:
- the name id
-
encodeNameIdBasedOnNameFormat
protected org.opensaml.saml.saml2.core.NameID encodeNameIdBasedOnNameFormat(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, java.lang.Object assertion, java.lang.String nameFormat, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)Encode name id based on name format name id.- Parameters:
authnRequest- the authn requestassertion- the assertionnameFormat- the name formatservice- the serviceadaptor- the adaptor- Returns:
- the name id
-
prepareNameIdAttribute
protected net.shibboleth.idp.attribute.IdPAttribute prepareNameIdAttribute(java.lang.Object casAssertion, java.lang.String nameFormat, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor, org.apereo.cas.support.saml.services.SamlRegisteredService registeredService)Prepare name id attribute id p attribute.- Parameters:
casAssertion- the assertionnameFormat- the name formatadaptor- the adaptorregisteredService- the registered service- Returns:
- the idp attribute
-
prepareNameIdEncoder
protected static net.shibboleth.idp.saml.attribute.encoding.impl.SAML2StringNameIDEncoder prepareNameIdEncoder(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, java.lang.String nameFormat, net.shibboleth.idp.attribute.IdPAttribute attribute, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)Prepare name id encoder saml 2 string name id encoder.- Parameters:
authnRequest- the authn requestnameFormat- the name formatattribute- the attributeservice- the serviceadaptor- the adaptor- Returns:
- the saml 2 string name id encoder
-
-