public class FrameworkUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
SESSION_DATA_KEY |
static String |
UTF_8 |
Modifier and Type | Method and Description |
---|---|
static void |
addAuthenticationContextToCache(String contextId,
AuthenticationContext context) |
static void |
addAuthenticationRequestToCache(String key,
AuthenticationRequestCacheEntry authReqEntry)
To add authentication request cache entry to cache
|
static void |
addAuthenticationResultToCache(String key,
AuthenticationResult authenticationResult) |
static void |
addSessionContextToCache(String key,
SessionContext sessionContext) |
static String |
appendQueryParamsStringToUrl(String url,
String queryParamString)
Append a query param to the URL (URL may already contain query params)
|
static Map<org.wso2.carbon.identity.application.common.model.ClaimMapping,String> |
buildClaimMappings(Map<String,String> attributeValue) |
static void |
endTenantFlow()
Ends the tenant flow
|
static ApplicationAuthenticator |
getAppAuthenticatorByName(String name) |
static javax.servlet.http.Cookie |
getAuthCookie(javax.servlet.http.HttpServletRequest req) |
static List<String> |
getAuthenticatedStepIdPs(List<String> stepIdPs,
List<String> authenticatedIdPs) |
static Map<String,AuthenticatorConfig> |
getAuthenticatedStepIdPs(StepConfig stepConfig,
Map<String,AuthenticatedIdPData> authenticatedIdPs) |
static AuthenticationContext |
getAuthenticationContextFromCache(String contextId) |
static AuthenticationRequestCacheEntry |
getAuthenticationRequestFromCache(String key)
To get authentication cache request from cache
|
static AuthenticationRequestHandler |
getAuthenticationRequestHandler() |
static AuthenticationResultCacheEntry |
getAuthenticationResultFromCache(String key)
To get authentication cache result from cache
|
static String |
getAuthenticatorIdPMappingString(List<AuthenticatorConfig> authConfigList) |
static Map<String,String> |
getAuthenticatorPropertyMapFromIdP(ExternalIdPConfig externalIdPConfig,
String name) |
static List<String> |
getCacheDisabledAuthenticators() |
static ClaimHandler |
getClaimHandler() |
static Map<String,String> |
getClaimMappings(org.wso2.carbon.identity.application.common.model.ClaimMapping[] claimMappings,
boolean useLocalDialectAsKey) |
static Map<String,String> |
getClaimMappings(Map<org.wso2.carbon.identity.application.common.model.ClaimMapping,String> claimMappings,
boolean useLocalDialectAsKey) |
static javax.servlet.http.HttpServletRequest |
getCommonAuthReqWithParams(javax.servlet.http.HttpServletRequest request,
AuthenticationRequestCacheEntry cacheEntry)
Builds the wrapper, wrapping incoming request and information take from cache entry
|
static AuthenticationContext |
getContextData(javax.servlet.http.HttpServletRequest request) |
static long |
getCurrentStandardNano()
create a nano time stamp relative to Unix Epoch
|
static String |
getFederatedSubjectFromClaims(AuthenticationContext context,
String otherDialect) |
static String |
getFederatedSubjectFromClaims(org.wso2.carbon.identity.application.common.model.IdentityProvider identityProvider,
Map<org.wso2.carbon.identity.application.common.model.ClaimMapping,String> claimMappings) |
static HomeRealmDiscoverer |
getHomeRealmDiscoverer() |
static Set<String> |
getKeySet(Map<org.wso2.carbon.identity.application.common.model.ClaimMapping,String> attributeValues) |
static Map<String,String> |
getLocalToSPClaimMappings(Map<String,String> claimMappings) |
static LogoutRequestHandler |
getLogoutRequestHandler() |
static int |
getMaxInactiveInterval() |
static ProvisioningHandler |
getProvisioningHandler() |
static String |
getQueryStringWithConfiguredParams(javax.servlet.http.HttpServletRequest request)
when getting query params through this, only configured params will be appended as query params
The required params can be configured from application-authenticators.xml
|
static String |
getQueryStringWithFrameworkContextId(String originalQueryStr,
String callerContextId,
String frameworkContextId) |
static RequestCoordinator |
getRequestCoordinator() |
static RequestPathBasedSequenceHandler |
getRequestPathBasedSequenceHandler() |
static SessionContext |
getSessionContextFromCache(String key) |
static StepBasedSequenceHandler |
getStepBasedSequenceHandler() |
static StepHandler |
getStepHandler() |
static List<String> |
getStepIdPs(StepConfig stepConfig) |
static String |
prependUserStoreDomainToName(String authenticatedSubject) |
static void |
removeAuthCookie(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
static void |
removeAuthenticationContextFromCache(String contextId) |
static void |
removeAuthenticationRequestFromCache(String key)
removes authentication request from cache.
|
static void |
removeAuthenticationResultFromCache(String autheticationResultId)
Removes authentication result from cache.
|
static void |
removeSessionContextFromCache(String key) |
static void |
sendToRetryPage(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
static void |
setMaxInactiveInterval(int maxInactiveInterval) |
static void |
setRequestPathCredentials(javax.servlet.http.HttpServletRequest req) |
static void |
startTenantFlow(String tenantDomain)
Starts the tenant flow for the given tenant domain
|
static void |
storeAuthCookie(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
String id) |
static void |
storeAuthCookie(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
String id,
Integer age) |
public static final String SESSION_DATA_KEY
public static final String UTF_8
public static void addAuthenticationRequestToCache(String key, AuthenticationRequestCacheEntry authReqEntry)
key
- cache entry keyauthReqEntry
- AuthenticationReqCache Entry.public static AuthenticationRequestCacheEntry getAuthenticationRequestFromCache(String key)
key
- Key of the cache entrypublic static void removeAuthenticationRequestFromCache(String key)
key
- SessionDataKeypublic static javax.servlet.http.HttpServletRequest getCommonAuthReqWithParams(javax.servlet.http.HttpServletRequest request, AuthenticationRequestCacheEntry cacheEntry)
request
- Original request coming to authentication frameworkcacheEntry
- Cache entry from the cache, which is added from calling servletspublic static ApplicationAuthenticator getAppAuthenticatorByName(String name)
name
- public static AuthenticationContext getContextData(javax.servlet.http.HttpServletRequest request)
request
- public static RequestCoordinator getRequestCoordinator()
public static AuthenticationRequestHandler getAuthenticationRequestHandler()
public static LogoutRequestHandler getLogoutRequestHandler()
public static StepBasedSequenceHandler getStepBasedSequenceHandler()
public static RequestPathBasedSequenceHandler getRequestPathBasedSequenceHandler()
public static StepHandler getStepHandler()
public static HomeRealmDiscoverer getHomeRealmDiscoverer()
public static ClaimHandler getClaimHandler()
public static ProvisioningHandler getProvisioningHandler()
public static void sendToRetryPage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
request
- response
- IOException
public static void removeAuthCookie(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
req
- resp
- public static void storeAuthCookie(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, String id)
req
- resp
- id
- public static void storeAuthCookie(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, String id, Integer age)
req
- resp
- id
- age
- public static javax.servlet.http.Cookie getAuthCookie(javax.servlet.http.HttpServletRequest req)
req
- public static void addAuthenticationContextToCache(String contextId, AuthenticationContext context)
contextId
- context
- public static void addAuthenticationResultToCache(String key, AuthenticationResult authenticationResult)
key
- authenticationResult
- public static AuthenticationResultCacheEntry getAuthenticationResultFromCache(String key)
key
- public static void removeAuthenticationResultFromCache(String autheticationResultId)
autheticationResultId
- public static void addSessionContextToCache(String key, SessionContext sessionContext)
key
- sessionContext
- public static SessionContext getSessionContextFromCache(String key)
key
- public static void removeSessionContextFromCache(String key)
key
- public static void removeAuthenticationContextFromCache(String contextId)
contextId
- public static AuthenticationContext getAuthenticationContextFromCache(String contextId)
contextId
- public static void setRequestPathCredentials(javax.servlet.http.HttpServletRequest req)
req
- public static Map<String,String> getAuthenticatorPropertyMapFromIdP(ExternalIdPConfig externalIdPConfig, String name)
externalIdPConfig
- name
- public static Map<org.wso2.carbon.identity.application.common.model.ClaimMapping,String> buildClaimMappings(Map<String,String> attributeValue)
attributeValue
- public static Set<String> getKeySet(Map<org.wso2.carbon.identity.application.common.model.ClaimMapping,String> attributeValues)
attributeValues
- public static Map<String,String> getClaimMappings(org.wso2.carbon.identity.application.common.model.ClaimMapping[] claimMappings, boolean useLocalDialectAsKey)
claimMappings
- public static Map<String,String> getClaimMappings(Map<org.wso2.carbon.identity.application.common.model.ClaimMapping,String> claimMappings, boolean useLocalDialectAsKey)
claimMappings
- useLocalDialectAsKey
- public static Map<String,String> getLocalToSPClaimMappings(Map<String,String> claimMappings)
claimMappings
- public static String getQueryStringWithFrameworkContextId(String originalQueryStr, String callerContextId, String frameworkContextId)
public static List<String> getStepIdPs(StepConfig stepConfig)
public static List<String> getAuthenticatedStepIdPs(List<String> stepIdPs, List<String> authenticatedIdPs)
public static Map<String,AuthenticatorConfig> getAuthenticatedStepIdPs(StepConfig stepConfig, Map<String,AuthenticatedIdPData> authenticatedIdPs)
public static String getAuthenticatorIdPMappingString(List<AuthenticatorConfig> authConfigList)
public static String getQueryStringWithConfiguredParams(javax.servlet.http.HttpServletRequest request)
request
- public static int getMaxInactiveInterval()
public static void setMaxInactiveInterval(int maxInactiveInterval)
public static String prependUserStoreDomainToName(String authenticatedSubject)
public static String getFederatedSubjectFromClaims(org.wso2.carbon.identity.application.common.model.IdentityProvider identityProvider, Map<org.wso2.carbon.identity.application.common.model.ClaimMapping,String> claimMappings)
public static String getFederatedSubjectFromClaims(AuthenticationContext context, String otherDialect) throws FrameworkException
FrameworkException
public static void startTenantFlow(String tenantDomain)
tenantDomain
- tenant domainpublic static void endTenantFlow()
public static long getCurrentStandardNano()
Copyright © 2016 WSO2. All rights reserved.