Package swiss.trustbroker.oidc.session
Class OidcSessionSupport
java.lang.Object
swiss.trustbroker.oidc.session.OidcSessionSupport
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckSessionHijacking(jakarta.servlet.http.HttpSession session) static voidcheckSessionOnFederationRedirect(String path, jakarta.servlet.http.HttpServletRequest request) static voidclearDerivedValuesFromAuthentication(String clientId, String sessionId, String principalName, TrustBrokerProperties trustBrokerProperties) static voidclearDerivedValuesFromAuthentication(TomcatSession session, Object context, TrustBrokerProperties trustBrokerProperties) static jakarta.servlet.http.CookiecreateOidcClientCookie(String clientId, String sessionId, int validSec, boolean secure, String sameSite) static jakarta.servlet.http.CookiecreateOidcSsoSessionCookie(String clientId, String cookieValue, jakarta.servlet.http.HttpServletRequest request, RelyingPartyDefinitions relyingPartyDefinitions, TrustBrokerProperties trustBrokerProperties) static voiddiscardOidcClientCookie(String clientId, jakarta.servlet.http.HttpServletResponse response, boolean secure) static voiddiscardOidcGlobalCookie(jakarta.servlet.http.HttpServletResponse response, boolean secure) static org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticatedPrincipalgetAuthenticatedPrincipal(TomcatSession tomcatSession) static StringgetClientIdFromOidcCookie(jakarta.servlet.http.HttpServletRequest request, RelyingPartyDefinitions relyingPartyDefinitions, NetworkConfig networkConfig) static StringgetInitialClientState(jakarta.servlet.http.HttpServletRequest request) static StringgetInitialRedirectUri(jakarta.servlet.http.HttpSession session) static Stringstatic StringgetOidcClientId(jakarta.servlet.http.HttpServletRequest request, RelyingPartyDefinitions relyingPartyDefinitions) static StringgetOidcClientId(jakarta.servlet.http.HttpServletRequest request, RelyingPartyDefinitions relyingPartyDefinitions, NetworkConfig networkConfig) static StringgetOidcClientIdFromHttpParams(jakarta.servlet.http.HttpServletRequest request, RelyingPartyDefinitions relyingPartyDefinitions, NetworkConfig networkConfig) static jakarta.servlet.http.CookiegetOidcCookie(jakarta.servlet.http.HttpServletRequest request, String clientId, NetworkConfig networkConfig) static Stringstatic StringgetOidcRelayState(jakarta.servlet.http.HttpServletRequest request, String relayStateParam) static Stringstatic StringgetOidcSessionId(jakarta.servlet.http.HttpServletRequest request, RelyingPartyDefinitions relyingPartyDefinitions, NetworkConfig networkConfig) static StringgetRedirectUri(jakarta.servlet.http.HttpServletRequest request) static StringgetSamlExchangeAcsUrlClientId(String acsUrl) static Stringstatic StringgetSamlExchangeClientId(String acsUrlPath) static org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticatedPrincipalgetSamlPrincipalFromAuthentication(org.springframework.security.core.Authentication authentication, jakarta.servlet.http.HttpServletRequest request) static StringgetSessionIdFromOidcCookie(jakarta.servlet.http.HttpServletRequest request, String clientId, NetworkConfig networkConfig) getSessionIdsFromAuthentication(org.springframework.security.core.Authentication authentication) static Stringstatic Stringstatic StateDatagetSsoStateDataForClient(SsoService ssoService, jakarta.servlet.http.HttpServletRequest request, RelyingParty relyingParty, String oidcClientId) static StateDatastatic StringgetStateParam(jakarta.servlet.http.HttpServletRequest request) static voidinvalidateSession(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, TrustBrokerProperties trustBrokerProperties, String clientId, String errMsg) static voidinvalidateSession(TrustBrokerProperties trustBrokerProperties, String errMsg) static voidinvalidateSsoState(jakarta.servlet.http.HttpServletRequest request, StateCacheService stateCacheService, StateData stateData, String actor) static booleanisAcrValuesChangeRequired(jakarta.servlet.http.HttpServletRequest request, TomcatSession session, String clientId) static voidrememberAcrValues(jakarta.servlet.http.HttpServletRequest request) static voidsetCurrentValuesFromExchange(TomcatSession session, String clientId, org.springframework.security.core.AuthenticatedPrincipal principal, String ssoSessionId, RelyingPartyDefinitions relyingPartyDefinitions, TrustBrokerProperties trustBrokerProperties) static voidsetFinalValuesFromAuthentication(TomcatSession session, Object context, RelyingPartyDefinitions relyingPartyDefinitions, TrustBrokerProperties trustBrokerProperties, StateCacheService stateCacheService, SsoService ssoService) static voidsetRedirectUri(jakarta.servlet.http.HttpSession session, String redirectUri)
-
Field Details
-
OIDC_SESSION_ID_LENGTH
public static final int OIDC_SESSION_ID_LENGTH- See Also:
-
OIDC_SESSION_ID_LENGTH_HEX
public static final int OIDC_SESSION_ID_LENGTH_HEX- See Also:
-
-
Method Details
-
getOidcClientId
-
getOidcClientId
public static String getOidcClientId(jakarta.servlet.http.HttpServletRequest request, RelyingPartyDefinitions relyingPartyDefinitions) -
getOidcClientId
public static String getOidcClientId(jakarta.servlet.http.HttpServletRequest request, RelyingPartyDefinitions relyingPartyDefinitions, NetworkConfig networkConfig) -
getOidcClientIdFromHttpParams
public static String getOidcClientIdFromHttpParams(jakarta.servlet.http.HttpServletRequest request, RelyingPartyDefinitions relyingPartyDefinitions, NetworkConfig networkConfig) -
getOidcSessionId
public static String getOidcSessionId(jakarta.servlet.http.HttpServletRequest request, RelyingPartyDefinitions relyingPartyDefinitions, NetworkConfig networkConfig) -
getSessionIdFromOidcCookie
public static String getSessionIdFromOidcCookie(jakarta.servlet.http.HttpServletRequest request, String clientId, NetworkConfig networkConfig) -
getClientIdFromOidcCookie
public static String getClientIdFromOidcCookie(jakarta.servlet.http.HttpServletRequest request, RelyingPartyDefinitions relyingPartyDefinitions, NetworkConfig networkConfig) -
createOidcSsoSessionCookie
public static jakarta.servlet.http.Cookie createOidcSsoSessionCookie(String clientId, String cookieValue, jakarta.servlet.http.HttpServletRequest request, RelyingPartyDefinitions relyingPartyDefinitions, TrustBrokerProperties trustBrokerProperties) -
createOidcClientCookie
-
getOidcCookie
public static jakarta.servlet.http.Cookie getOidcCookie(jakarta.servlet.http.HttpServletRequest request, String clientId, NetworkConfig networkConfig) -
getRedirectUri
-
setRedirectUri
-
getInitialRedirectUri
-
getInitialClientState
-
getOidcSessionId
-
getOidcRelayState
-
getOidcRelayState
-
getStateData
-
getSsoSessionId
-
getSessionIdsFromAuthentication
-
getSamlPrincipalFromAuthentication
public static org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticatedPrincipal getSamlPrincipalFromAuthentication(org.springframework.security.core.Authentication authentication, jakarta.servlet.http.HttpServletRequest request) -
checkSessionHijacking
public static void checkSessionHijacking(jakarta.servlet.http.HttpSession session) -
checkSessionOnFederationRedirect
public static void checkSessionOnFederationRedirect(String path, jakarta.servlet.http.HttpServletRequest request) -
setCurrentValuesFromExchange
public static void setCurrentValuesFromExchange(TomcatSession session, String clientId, org.springframework.security.core.AuthenticatedPrincipal principal, String ssoSessionId, RelyingPartyDefinitions relyingPartyDefinitions, TrustBrokerProperties trustBrokerProperties) -
setFinalValuesFromAuthentication
public static void setFinalValuesFromAuthentication(TomcatSession session, Object context, RelyingPartyDefinitions relyingPartyDefinitions, TrustBrokerProperties trustBrokerProperties, StateCacheService stateCacheService, SsoService ssoService) -
clearDerivedValuesFromAuthentication
public static void clearDerivedValuesFromAuthentication(String clientId, String sessionId, String principalName, TrustBrokerProperties trustBrokerProperties) -
clearDerivedValuesFromAuthentication
public static void clearDerivedValuesFromAuthentication(TomcatSession session, Object context, TrustBrokerProperties trustBrokerProperties) -
getAuthenticatedPrincipal
public static org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticatedPrincipal getAuthenticatedPrincipal(TomcatSession tomcatSession) -
getSsoStateDataForClient
public static StateData getSsoStateDataForClient(SsoService ssoService, jakarta.servlet.http.HttpServletRequest request, RelyingParty relyingParty, String oidcClientId) -
getSamlExchangeClientId
-
getSamlExchangeClientId
-
getSamlExchangeAcsUrlClientId
-
invalidateSession
-
invalidateSession
public static void invalidateSession(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, TrustBrokerProperties trustBrokerProperties, String clientId, String errMsg) -
discardOidcGlobalCookie
public static void discardOidcGlobalCookie(jakarta.servlet.http.HttpServletResponse response, boolean secure) -
discardOidcClientCookie
public static void discardOidcClientCookie(String clientId, jakarta.servlet.http.HttpServletResponse response, boolean secure) -
invalidateSsoState
public static void invalidateSsoState(jakarta.servlet.http.HttpServletRequest request, StateCacheService stateCacheService, StateData stateData, String actor) -
getStateParam
-
getSessionInitiator
-
rememberAcrValues
public static void rememberAcrValues(jakarta.servlet.http.HttpServletRequest request) -
isAcrValuesChangeRequired
public static boolean isAcrValuesChangeRequired(jakarta.servlet.http.HttpServletRequest request, TomcatSession session, String clientId)
-