public class WSFederationUtils extends Object
Modifier and Type | Field and Description |
---|---|
static ResourceBundle |
bundle
Resource bundle for the WS-Federation implementation.
|
static Debug |
debug
Debug instance for use by WS-Federation implementation. |
static DataStoreProvider |
dsProvider |
static SessionProvider |
sessionProvider |
Modifier and Type | Method and Description |
---|---|
static String |
accountRealmFromUserAgent(String uaHeader,
String accountRealmCookieName)
Extracts the home account realm from the user agent HTTP header.
|
static SAML11RequestedSecurityToken |
createSAML11Token(String realm,
String idpEntityId,
String spEntityId,
Object session,
String spTokenIssuerName,
String authMethod,
boolean wantAssertionSigned)
Creates a SAML 1.1 token object based on the provided details.
|
static WSFederationMetaManager |
getMetaManager()
Returns an instance of
WSFederationMetaManager . |
static boolean |
isSignatureValid(Assertion assertion,
String realm,
String issuer)
Determine the validity of the signature on the
Assertion |
static boolean |
isTimeValid(Assertion assertion,
int timeskew)
Determines the timeliness of the assertion.
|
static boolean |
isWReplyURLValid(javax.servlet.http.HttpServletRequest request,
String relayState)
Convenience method to validate a WSFederation wreply URL, often called from a JSP.
|
static boolean |
isWReplyURLValid(String metaAlias,
String wreply,
String role)
Convenience method to validate a WSFederation wreply URL, often called from a JSP.
|
static void |
processMultiProtocolLogout(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object userSession)
Processes Single Logout cross multiple federation protocols
|
static String |
putReplyURL(String wreply)
Put a reply URL in the wctx->wreply map.
|
static String |
removeReplyURL(String wctx)
Remove and return a reply URL from the wctx->wreply map.
|
static void |
validateWReplyURL(String orgName,
String hostEntityId,
String wreply,
String role)
Validates the Wreply URL against a list of wreply State
URLs created on the hosted service provider.
|
public static Debug debug
Debug
instance for use by WS-Federation implementation.public static ResourceBundle bundle
public static DataStoreProvider dsProvider
public static SessionProvider sessionProvider
public static WSFederationMetaManager getMetaManager()
WSFederationMetaManager
.WSFederationMetaManager
.public static String accountRealmFromUserAgent(String uaHeader, String accountRealmCookieName)
uaHeader
- user agent HTTP header. User agent header must be
semi-colon separated, of the form Mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1;
amWSFederationAccountRealm:Adatum Corp)
.accountRealmCookieName
- identifier with which to search user agent
HTTP header.public static String putReplyURL(String wreply)
wreply
- reply URLpublic static String removeReplyURL(String wctx)
wctx
- WS-Federation context parameterpublic static boolean isSignatureValid(Assertion assertion, String realm, String issuer)
Assertion
assertion
- SAML 1.1 Assertionrealm
- Realm for the issuerissuer
- Assertion issuer - used to retrieve certificate for
signature validation.public static boolean isTimeValid(Assertion assertion, int timeskew)
assertion
- SAML 1.1 Assertiontimeskew
- in secondspublic static void processMultiProtocolLogout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object userSession)
request
- HttpServletRequest object.response
- HttpServletResponse objectpublic static boolean isWReplyURLValid(javax.servlet.http.HttpServletRequest request, String relayState)
request
- Used to help establish the realm and hostEntityID.relayState
- The URL to validate.true
if the wreply is valid.public static boolean isWReplyURLValid(String metaAlias, String wreply, String role)
metaAlias
- The metaAlias of the hosted entity.wreply
- The URL to validate.role
- The role of the caller.true
if the wreply is valid.public static void validateWReplyURL(String orgName, String hostEntityId, String wreply, String role) throws WSFederationException
orgName
- realm or organization name the provider resides in.hostEntityId
- Entity ID of the hosted provider.wreply
- wreply URL.role
- IDP/SP Role.WSFederationException
- if the processing failed.public static SAML11RequestedSecurityToken createSAML11Token(String realm, String idpEntityId, String spEntityId, Object session, String spTokenIssuerName, String authMethod, boolean wantAssertionSigned) throws WSFederationException
realm
- The realm of the WS-Fed entitiesidpEntityId
- The WS-Fed IdP (IP) entity ID.spEntityId
- The WS-Fed SP (RP) entity ID.session
- The authenticated session object.spTokenIssuerName
- The name of the token issuer corresponding to the SP (RP).authMethod
- The authentication method to specify in the AuthenticationStatement.wantAssertionSigned
- Whether the assertion should be signed.WSFederationException
- If there was an error while creating the SAML1.1 token.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.