public class Auth extends Object
Constructor and Description |
---|
Auth()
Initializes the SP SAML instance.
|
Auth(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Initializes the SP SAML instance.
|
Auth(KeyStoreSettings keyStoreSetting)
Initializes the SP SAML instance.
|
Auth(KeyStoreSettings keyStoreSetting,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Initializes the SP SAML instance.
|
Auth(Saml2Settings settings,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Initializes the SP SAML instance.
|
Auth(String filename)
Initializes the SP SAML instance.
|
Auth(String filename,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Initializes the SP SAML instance.
|
Auth(String filename,
KeyStoreSettings keyStoreSetting)
Initializes the SP SAML instance.
|
Auth(String filename,
KeyStoreSettings keyStoreSetting,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Initializes the SP SAML instance.
|
Modifier and Type | Method and Description |
---|---|
String |
buildRequestSignature(String samlRequest,
String relayState,
String signAlgorithm)
Generates the Signature for a SAML Request
|
String |
buildResponseSignature(String samlResponse,
String relayState,
String signAlgorithm)
Generates the Signature for a SAML Response
|
Collection<String> |
getAttribute(String name) |
Map<String,List<String>> |
getAttributes() |
List<String> |
getAttributesName() |
List<String> |
getErrors() |
String |
getLastAssertionId() |
List<org.joda.time.Instant> |
getLastAssertionNotOnOrAfter() |
String |
getLastErrorReason() |
String |
getLastMessageId() |
String |
getLastRequestId() |
String |
getLastRequestXML()
Returns the most recently-constructed/processed XML SAML request
(AuthNRequest, LogoutRequest)
|
String |
getLastResponseXML()
Returns the most recently-constructed/processed XML SAML response
(SAMLResponse, LogoutResponse).
|
Exception |
getLastValidationException() |
String |
getNameId() |
String |
getNameIdFormat() |
String |
getNameIdNameQualifier() |
String |
getNameIdSPNameQualifier() |
org.joda.time.DateTime |
getSessionExpiration() |
String |
getSessionIndex() |
Saml2Settings |
getSettings() |
String |
getSLOResponseUrl() |
String |
getSLOurl() |
String |
getSSOurl() |
boolean |
isAuthenticated() |
Boolean |
isDebugActive() |
void |
login()
Initiates the SSO process.
|
void |
login(String returnTo)
Initiates the SSO process.
|
void |
login(String returnTo,
Boolean forceAuthn,
Boolean isPassive,
Boolean setNameIdPolicy)
Initiates the SSO process.
|
String |
login(String returnTo,
Boolean forceAuthn,
Boolean isPassive,
Boolean setNameIdPolicy,
Boolean stay)
Initiates the SSO process.
|
String |
login(String returnTo,
Boolean forceAuthn,
Boolean isPassive,
Boolean setNameIdPolicy,
Boolean stay,
String nameIdValueReq)
Initiates the SSO process.
|
void |
logout()
Initiates the SLO process.
|
void |
logout(String returnTo)
Initiates the SLO process.
|
void |
logout(String returnTo,
String nameId,
String sessionIndex)
Initiates the SLO process.
|
String |
logout(String returnTo,
String nameId,
String sessionIndex,
Boolean stay)
Initiates the SLO process.
|
String |
logout(String returnTo,
String nameId,
String sessionIndex,
Boolean stay,
String nameidFormat)
Initiates the SLO process.
|
String |
logout(String returnTo,
String nameId,
String sessionIndex,
Boolean stay,
String nameidFormat,
String nameIdNameQualifier)
Initiates the SLO process.
|
String |
logout(String returnTo,
String nameId,
String sessionIndex,
Boolean stay,
String nameidFormat,
String nameIdNameQualifier,
String nameIdSPNameQualifier)
Initiates the SLO process.
|
void |
logout(String returnTo,
String nameId,
String sessionIndex,
String nameidFormat)
Initiates the SLO process.
|
void |
logout(String returnTo,
String nameId,
String sessionIndex,
String nameidFormat,
String nameIdNameQualifier)
Initiates the SLO process.
|
void |
logout(String returnTo,
String nameId,
String sessionIndex,
String nameidFormat,
String nameIdNameQualifier,
String nameIdSPNameQualifier)
Initiates the SLO process.
|
void |
processResponse()
Process the SAML Response sent by the IdP.
|
void |
processResponse(String requestId)
Process the SAML Response sent by the IdP.
|
void |
processSLO()
Process the SAML Logout Response / Logout Request sent by the IdP.
|
void |
processSLO(Boolean keepLocalSession,
String requestId)
Process the SAML Logout Response / Logout Request sent by the IdP.
|
String |
processSLO(Boolean keepLocalSession,
String requestId,
Boolean stay)
Process the SAML Logout Response / Logout Request sent by the IdP.
|
void |
setStrict(Boolean value)
Set the strict mode active/disable
|
public Auth() throws IOException, SettingsException, Error
IOException
SettingsException
Error
public Auth(KeyStoreSettings keyStoreSetting) throws IOException, SettingsException, Error
keyStoreSetting
- KeyStoreSettings is a KeyStore which have the Private/Public keysIOException
SettingsException
Error
public Auth(String filename) throws IOException, SettingsException, Error
filename
- String Filename with the settingsIOException
SettingsException
Error
public Auth(String filename, KeyStoreSettings keyStoreSetting) throws IOException, SettingsException, Error
filename
- String Filename with the settingskeyStoreSetting
- KeyStoreSettings is a KeyStore which have the Private/Public keysIOException
SettingsException
Error
public Auth(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, SettingsException, Error
request
- HttpServletRequest object to be processedresponse
- HttpServletResponse object to be usedIOException
SettingsException
Error
public Auth(KeyStoreSettings keyStoreSetting, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, SettingsException, Error
keyStoreSetting
- KeyStoreSettings is a KeyStore which have the Private/Public keysrequest
- HttpServletRequest object to be processedresponse
- HttpServletResponse object to be usedIOException
SettingsException
Error
public Auth(String filename, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws SettingsException, IOException, Error
filename
- String Filename with the settingsrequest
- HttpServletRequest object to be processedresponse
- HttpServletResponse object to be usedSettingsException
IOException
Error
public Auth(String filename, KeyStoreSettings keyStoreSetting, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws SettingsException, IOException, Error
filename
- String Filename with the settingskeyStoreSetting
- KeyStoreSettings is a KeyStore which have the Private/Public keysrequest
- HttpServletRequest object to be processedresponse
- HttpServletResponse object to be usedSettingsException
IOException
Error
public Auth(Saml2Settings settings, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws SettingsException
settings
- Saml2Settings object. Setting datarequest
- HttpServletRequest object to be processedresponse
- HttpServletResponse object to be usedSettingsException
public void setStrict(Boolean value)
value
- Strict valuepublic String login(String returnTo, Boolean forceAuthn, Boolean isPassive, Boolean setNameIdPolicy, Boolean stay, String nameIdValueReq) throws IOException, SettingsException
returnTo
- The target URL the user should be returned to after
login (relayState). Will be a self-routed URL when
null, or not be appended at all when an empty string
is providedforceAuthn
- When true the AuthNRequest will set the
ForceAuthn='true'isPassive
- When true the AuthNRequest will set the
IsPassive='true'setNameIdPolicy
- When true the AuthNRequest will set a nameIdPolicystay
- True if we want to stay (returns the url string) False
to execute redirectionnameIdValueReq
- Indicates to the IdP the subject that should be
authenticatedIOException
SettingsException
public String login(String returnTo, Boolean forceAuthn, Boolean isPassive, Boolean setNameIdPolicy, Boolean stay) throws IOException, SettingsException
returnTo
- The target URL the user should be returned to after
login (relayState). Will be a self-routed URL when
null, or not be appended at all when an empty string
is providedforceAuthn
- When true the AuthNRequest will set the
ForceAuthn='true'isPassive
- When true the AuthNRequest will set the
IsPassive='true'setNameIdPolicy
- When true the AuthNRequest will set a nameIdPolicystay
- True if we want to stay (returns the url string) False
to execute redirectionIOException
SettingsException
public void login(String returnTo, Boolean forceAuthn, Boolean isPassive, Boolean setNameIdPolicy) throws IOException, SettingsException
returnTo
- The target URL the user should be returned to after
login (relayState). Will be a self-routed URL when
null, or not be appended at all when an empty string
is providedforceAuthn
- When true the AuthNRequest will set the
ForceAuthn='true'isPassive
- When true the AuthNRequest will set the
IsPassive='true'setNameIdPolicy
- When true the AuthNRequest will set a nameIdPolicyIOException
SettingsException
public void login() throws IOException, SettingsException
IOException
SettingsException
public void login(String returnTo) throws IOException, SettingsException
returnTo
- The target URL the user should be returned to after login
(relayState). Will be a self-routed URL when null, or not be
appended at all when an empty string is provided.IOException
SettingsException
public String logout(String returnTo, String nameId, String sessionIndex, Boolean stay, String nameidFormat, String nameIdNameQualifier, String nameIdSPNameQualifier) throws IOException, XMLEntityException, SettingsException
returnTo
- The target URL the user should be returned to
after logout (relayState). Will be a self-routed
URL when null, or not be appended at all when an
empty string is providednameId
- The NameID that will be set in the
LogoutRequest.sessionIndex
- The SessionIndex (taken from the SAML Response
in the SSO process).stay
- True if we want to stay (returns the url string)
False to execute redirectionnameidFormat
- The NameID Format that will be set in the
LogoutRequest.nameIdNameQualifier
- The NameID NameQualifier that will be set in the
LogoutRequest.nameIdSPNameQualifier
- The NameID SP Name Qualifier that will be set in
the LogoutRequest.IOException
XMLEntityException
SettingsException
public String logout(String returnTo, String nameId, String sessionIndex, Boolean stay, String nameidFormat, String nameIdNameQualifier) throws IOException, XMLEntityException, SettingsException
returnTo
- The target URL the user should be returned to
after logout (relayState). Will be a self-routed
URL when null, or not be appended at all when an
empty string is providednameId
- The NameID that will be set in the LogoutRequest.sessionIndex
- The SessionIndex (taken from the SAML Response in
the SSO process).stay
- True if we want to stay (returns the url string)
False to execute redirectionnameidFormat
- The NameID Format will be set in the
LogoutRequest.nameIdNameQualifier
- The NameID NameQualifier will be set in the
LogoutRequest.IOException
XMLEntityException
SettingsException
public String logout(String returnTo, String nameId, String sessionIndex, Boolean stay, String nameidFormat) throws IOException, XMLEntityException, SettingsException
returnTo
- The target URL the user should be returned to after
logout (relayState). Will be a self-routed URL when null,
or not be appended at all when an empty string is
providednameId
- The NameID that will be set in the LogoutRequest.sessionIndex
- The SessionIndex (taken from the SAML Response in the SSO
process).stay
- True if we want to stay (returns the url string) False to
execute redirectionnameidFormat
- The NameID Format will be set in the LogoutRequest.IOException
XMLEntityException
SettingsException
public String logout(String returnTo, String nameId, String sessionIndex, Boolean stay) throws IOException, XMLEntityException, SettingsException
returnTo
- The target URL the user should be returned to after
logout (relayState). Will be a self-routed URL when null,
or not be appended at all when an empty string is
providednameId
- The NameID that will be set in the LogoutRequest.sessionIndex
- The SessionIndex (taken from the SAML Response in the SSO
process).stay
- True if we want to stay (returns the url string) False to
execute redirectionIOException
XMLEntityException
SettingsException
public void logout(String returnTo, String nameId, String sessionIndex, String nameidFormat, String nameIdNameQualifier, String nameIdSPNameQualifier) throws IOException, XMLEntityException, SettingsException
returnTo
- The target URL the user should be returned to
after logout (relayState). Will be a self-routed
URL when null, or not be appended at all when an
empty string is providednameId
- The NameID that will be set in the
LogoutRequest.sessionIndex
- The SessionIndex (taken from the SAML Response
in the SSO process).nameidFormat
- The NameID Format will be set in the
LogoutRequest.nameIdNameQualifier
- The NameID NameQualifier that will be set in the
LogoutRequest.nameIdSPNameQualifier
- The NameID SP Name Qualifier that will be set in
the LogoutRequest.IOException
XMLEntityException
SettingsException
public void logout(String returnTo, String nameId, String sessionIndex, String nameidFormat, String nameIdNameQualifier) throws IOException, XMLEntityException, SettingsException
returnTo
- The target URL the user should be returned to
after logout (relayState). Will be a self-routed
URL when null, or not be appended at all when an
empty string is providednameId
- The NameID that will be set in the LogoutRequest.sessionIndex
- The SessionIndex (taken from the SAML Response in
the SSO process).nameidFormat
- The NameID Format will be set in the
LogoutRequest.nameIdNameQualifier
- The NameID NameQualifier will be set in the
LogoutRequest.IOException
XMLEntityException
SettingsException
public void logout(String returnTo, String nameId, String sessionIndex, String nameidFormat) throws IOException, XMLEntityException, SettingsException
returnTo
- The target URL the user should be returned to after
logout (relayState). Will be a self-routed URL when null,
or not be appended at all when an empty string is
providednameId
- The NameID that will be set in the LogoutRequest.sessionIndex
- The SessionIndex (taken from the SAML Response in the SSO
process).nameidFormat
- The NameID Format will be set in the LogoutRequest.IOException
XMLEntityException
SettingsException
public void logout(String returnTo, String nameId, String sessionIndex) throws IOException, XMLEntityException, SettingsException
returnTo
- The target URL the user should be returned to after
logout (relayState). Will be a self-routed URL when null,
or not be appended at all when an empty string is
providednameId
- The NameID that will be set in the LogoutRequest.sessionIndex
- The SessionIndex (taken from the SAML Response in the SSO
process).IOException
XMLEntityException
SettingsException
public void logout() throws IOException, XMLEntityException, SettingsException
public void logout(String returnTo) throws IOException, XMLEntityException, SettingsException
returnTo
- The target URL the user should be returned to after logout
(relayState). Will be a self-routed URL when null, or not be
appended at all when an empty string is providedIOException
XMLEntityException
SettingsException
public String getSSOurl()
public String getSLOurl()
public String getSLOResponseUrl()
public void processResponse(String requestId) throws Exception
requestId
- The ID of the AuthNRequest sent by this SP to the IdPException
public void processResponse() throws Exception
Exception
public String processSLO(Boolean keepLocalSession, String requestId, Boolean stay) throws Exception
keepLocalSession
- When true will keep the local session, otherwise will
destroy itrequestId
- The ID of the LogoutRequest sent by this SP to the
IdPstay
- True if we want to stay (returns the url string) False
to execute redirectionException
public void processSLO(Boolean keepLocalSession, String requestId) throws Exception
keepLocalSession
- When true will keep the local session, otherwise will
destroy itrequestId
- The ID of the LogoutRequest sent by this SP to the
IdPException
public void processSLO() throws Exception
Exception
public final boolean isAuthenticated()
public final List<String> getAttributesName()
public final Map<String,List<String>> getAttributes()
public final Collection<String> getAttribute(String name)
name
- Name of the attributepublic final String getNameId()
public final String getNameIdFormat()
public final String getNameIdNameQualifier()
public final String getNameIdSPNameQualifier()
public final String getSessionIndex()
public final org.joda.time.DateTime getSessionExpiration()
public String getLastMessageId()
public String getLastAssertionId()
public List<org.joda.time.Instant> getLastAssertionNotOnOrAfter()
public List<String> getErrors()
public String getLastErrorReason()
public Exception getLastValidationException()
public String getLastRequestId()
public Saml2Settings getSettings()
public Boolean isDebugActive()
public String buildRequestSignature(String samlRequest, String relayState, String signAlgorithm) throws SettingsException
samlRequest
- The SAML RequestrelayState
- The RelayStatesignAlgorithm
- Signature algorithm methodSettingsException
public String buildResponseSignature(String samlResponse, String relayState, String signAlgorithm) throws SettingsException
samlResponse
- The SAML ResponserelayState
- The RelayStatesignAlgorithm
- Signature algorithm methodSettingsException
public String getLastRequestXML()
public String getLastResponseXML()
Copyright © 2020. All rights reserved.