@Override public boolean canHandle(IdentityRequest identityRequest) { IdentityMessageContext context = getContextIfAvailable(identityRequest); if (context != null) { if (context.getRequest() instanceof SAMLSpInitRequest || context.getRequest() instanceof SAMLIdpInitRequest) { return true; } } return false; }
@Override protected FrameworkLoginResponse.FrameworkLoginResponseBuilder buildResponseForFrameworkLogin(IdentityMessageContext context) { IdentityRequest identityRequest = context.getRequest(); Map parameterMap = identityRequest.getParameterMap(); AuthenticationRequest authenticationRequest = new AuthenticationRequest(); authenticationRequest.setPassiveAuth(Boolean.parseBoolean(String.valueOf(context.getParameter("passiveAuth")))); authenticationRequest.setForceAuth(Boolean.parseBoolean(String.valueOf(context.getParameter("forceAuth"))));
/** * Processes the IdentityMessageContext and retrieved the using {@code sessionDataKey} parameter and sets the * AuthenticationResult to message context if found in AuthenticationResultCache * * @param context IdentityMessageContext * @param identityRequest Current IdentityRequest object * @return AuthenticationResult */ protected AuthenticationResult processResponseFromFrameworkLogin(IdentityMessageContext context, IdentityRequest identityRequest) { String sessionDataKey = identityRequest.getParameter(InboundConstants.RequestProcessor.CONTEXT_KEY); AuthenticationResultCacheEntry entry = FrameworkUtils.getAuthenticationResultFromCache(sessionDataKey); AuthenticationResult authnResult = null; if(entry != null) { authnResult = entry.getResult(); } else { throw FrameworkRuntimeException.error("Cannot find AuthenticationResult from the cache"); } FrameworkUtils.removeAuthenticationResultFromCache(sessionDataKey); if (authnResult.isAuthenticated()) { context.addParameter(InboundConstants.RequestProcessor.AUTHENTICATION_RESULT, authnResult); } return authnResult; } }
IdentityMessageContext context) { IdentityRequest identityRequest = context.getRequest(); Map<String, String[]> parameterMap = identityRequest.getParameterMap(); authenticationRequest.setType(getType(context)); authenticationRequest.setPassiveAuth(Boolean.parseBoolean( String.valueOf(context.getParameter(InboundConstants.PassiveAuth)))); authenticationRequest.setForceAuth(Boolean.parseBoolean( String.valueOf(context.getParameter(InboundConstants.ForceAuth)))); try { authenticationRequest.setCommonAuthCallerPath(URLEncoder.encode(getCallbackPath(context),
/** * Processes the IdentityMessageContext and retrieved the using {@code sessionDataKey} parameter and sets the * AuthenticationResult to message context if found in AuthenticationResultCache * * @param context IdentityMessageContext * @param identityRequest Current IdentityRequest object * @return AuthenticationResult */ protected AuthenticationResult processResponseFromFrameworkLogin(IdentityMessageContext context, IdentityRequest identityRequest) { String sessionDataKey = identityRequest.getParameter(InboundConstants.RequestProcessor.CONTEXT_KEY); AuthenticationResultCacheEntry entry = FrameworkUtils.getAuthenticationResultFromCache(sessionDataKey); AuthenticationResult authnResult = null; if(entry != null) { authnResult = entry.getResult(); } else { throw FrameworkRuntimeException.error("Cannot find AuthenticationResult from the cache"); } FrameworkUtils.removeAuthenticationResultFromCache(sessionDataKey); if (authnResult.isAuthenticated()) { context.addParameter(InboundConstants.RequestProcessor.AUTHENTICATION_RESULT, authnResult); } return authnResult; } }
protected FrameworkLoginResponse.FrameworkLoginResponseBuilder buildResponseForFrameworkLogin( IdentityMessageContext context) { IdentityRequest identityRequest = context.getRequest(); Map<String, String[]> parameterMap = identityRequest.getParameterMap(); authenticationRequest.setType(getName()); authenticationRequest.setPassiveAuth(Boolean.parseBoolean( String.valueOf(context.getParameter(InboundConstants.PassiveAuth)))); authenticationRequest.setForceAuth(Boolean.parseBoolean( String.valueOf(context.getParameter(InboundConstants.ForceAuth)))); authenticationRequest.setTenantDomain(((SAMLMessageContext) context).getTenantDomain()); try {
@Override public boolean canHandle(IdentityRequest identityRequest) { IdentityMessageContext context = getContextIfAvailable(identityRequest); if (context != null) { if (context.getRequest() instanceof CASSpInitRequest) { return true; } } return false; }
/** * Processes the IdentityMessageContext and retrieved the using {@code sessionDataKey} parameter and sets the * AuthenticationResult to message context if found in AuthenticationResultCache * * @param context IdentityMessageContext * @param identityRequest Current IdentityRequest object * @return AuthenticationResult */ protected AuthenticationResult processResponseFromFrameworkLogin(IdentityMessageContext context, IdentityRequest identityRequest) { String sessionDataKey = identityRequest.getParameter(InboundConstants.RequestProcessor.CONTEXT_KEY); AuthenticationResultCacheEntry entry = FrameworkUtils.getAuthenticationResultFromCache(sessionDataKey); AuthenticationResult authnResult = null; if(entry != null) { authnResult = entry.getResult(); } else { throw FrameworkRuntimeException.error("Cannot find AuthenticationResult from the cache"); } FrameworkUtils.removeAuthenticationResultFromCache(sessionDataKey); if (authnResult.isAuthenticated()) { context.addParameter(InboundConstants.RequestProcessor.AUTHENTICATION_RESULT, authnResult); } return authnResult; } }
IdentityMessageContext context) { IdentityRequest identityRequest = context.getRequest(); Map<String, String[]> parameterMap = identityRequest.getParameterMap(); authenticationRequest.setType(getType(context)); authenticationRequest.setPassiveAuth(Boolean.parseBoolean( String.valueOf(context.getParameter(InboundConstants.PassiveAuth)))); authenticationRequest.setForceAuth(Boolean.parseBoolean( String.valueOf(context.getParameter(InboundConstants.ForceAuth)))); try { authenticationRequest.setCommonAuthCallerPath(URLEncoder.encode(getCallbackPath(context),
/** * Get SSO cookie from request. * * @param context * @return */ public static Cookie getTokenIdCookie(IdentityMessageContext context) { Cookie[] cookies = context.getRequest().getCookies(); if (cookies != null) { for (Cookie cookie : cookies) { if (StringUtils.equals(cookie.getName(), SAML_TOKEN_ID_COOKIE_NAME)) { return cookie; } } } return null; }
IdentityMessageContext context) { IdentityRequest identityRequest = context.getRequest(); Map<String, String[]> parameterMap = identityRequest.getParameterMap(); authenticationRequest.setType(getName()); authenticationRequest.setPassiveAuth(Boolean.parseBoolean( String.valueOf(context.getParameter(InboundConstants.PassiveAuth)))); authenticationRequest.setForceAuth(Boolean.parseBoolean( String.valueOf(context.getParameter(InboundConstants.ForceAuth)))); try { authenticationRequest.setCommonAuthCallerPath(URLEncoder.encode(getCallbackPath(context),
public void addToCache(String key, IdentityMessageContext context) { super.addToCache(key, context); if (enableRequestScopeCache) { int tenantId = MultitenantConstants.INVALID_TENANT_ID; String tenantDomain = context.getRequest().getTenantDomain(); if (tenantDomain != null) { tenantId = IdentityTenantUtil.getTenantId(tenantDomain); } SessionDataStore.getInstance().storeSessionData(key, INBOUND_CONTEXT_CACHE_NAME, context, tenantId); } }
public void addToCache(String key, IdentityMessageContext context) { super.addToCache(key, context); if (enableRequestScopeCache) { int tenantId = MultitenantConstants.INVALID_TENANT_ID; String tenantDomain = context.getRequest().getTenantDomain(); if (tenantDomain != null) { tenantId = IdentityTenantUtil.getTenantId(tenantDomain); } SessionDataStore.getInstance().storeSessionData(key, INBOUND_CONTEXT_CACHE_NAME, context, tenantId); } }
public void addToCache(String key, IdentityMessageContext context) { super.addToCache(key, context); if (enableRequestScopeCache) { int tenantId = MultitenantConstants.INVALID_TENANT_ID; String tenantDomain = context.getRequest().getTenantDomain(); if (tenantDomain != null) { tenantId = IdentityTenantUtil.getTenantId(tenantDomain); } SessionDataStore.getInstance().storeSessionData(key, INBOUND_CONTEXT_CACHE_NAME, context, tenantId); } }
protected SAMLCloudFrameworkLogoutResponse.SAMLCloudFrameworkLogoutResponseBuilder buildResponseForCloudLogout( IdentityMessageContext context) { IdentityRequest identityRequest = context.getRequest(); Map parameterMap = identityRequest.getParameterMap(); AuthenticationRequest authenticationRequest = new AuthenticationRequest();
IdentityMessageContext context) { IdentityRequest identityRequest = context.getRequest(); Map<String, String[]> parameterMap = identityRequest.getParameterMap();
IdentityMessageContext context) { IdentityRequest identityRequest = context.getRequest(); Map<String, String[]> parameterMap = identityRequest.getParameterMap();
IdentityMessageContext context) { IdentityRequest identityRequest = context.getRequest(); Map<String, String[]> parameterMap = identityRequest.getParameterMap();