/** * To handle exceptions. * * @param errorMessage Error Message * @param errorCode Error Code. * @param e Exception that is thrown during a failure. * @throws PostAuthenticationFailedException Post Authentication Failed Exception. */ private void handleExceptions(String errorMessage, String errorCode, Exception e) throws PostAuthenticationFailedException { throw new PostAuthenticationFailedException(errorCode, errorMessage, e); }
public static FrameworkException error(String message, Throwable cause) { return new FrameworkException(message, cause); } }
private String getAuthorizationCode(HttpServletRequest request) throws ApplicationAuthenticatorException { OAuthAuthzResponse authzResponse; try { authzResponse = OAuthAuthzResponse.oauthCodeAuthzResponse(request); return authzResponse.getCode(); } catch (OAuthProblemException e) { throw new ApplicationAuthenticatorException("Exception while reading authorization code.", e); } }
public HttpIdentityResponse.HttpIdentityResponseBuilder handleException(FrameworkException exception) { HttpIdentityResponse.HttpIdentityResponseBuilder builder = new HttpIdentityResponse.HttpIdentityResponseBuilder(); builder.setStatusCode(500); builder.setBody(exception.getMessage()); return builder; } }
public static FrameworkException error(String message) { return new FrameworkException(message); }
protected String getAuthorizationCode(HttpServletRequest request) throws ApplicationAuthenticatorException { OAuthAuthzResponse authzResponse; try { authzResponse = OAuthAuthzResponse.oauthCodeAuthzResponse(request); return authzResponse.getCode(); } catch (OAuthProblemException e) { throw new ApplicationAuthenticatorException("Exception while reading authorization code.", e); } }
/** * To handle exceptions. * * @param errorMessage Error Message * @param errorCode Error Code. * @param e Exception that is thrown during a failure. * @throws PostAuthenticationFailedException Post Authentication Failed Exception. */ private void handleExceptions(String errorMessage, String errorCode, Exception e) throws PostAuthenticationFailedException { throw new PostAuthenticationFailedException(errorCode, errorMessage, e); }
private ClaimManager getClaimManager(String tenantDomain, UserRealm realm) throws FrameworkException { ClaimManager claimManager = null; try { claimManager = realm.getClaimManager(); } catch (UserStoreException e) { throw new FrameworkException("Error occurred while retrieving the ClaimManager " + "from Realm for " + tenantDomain + " to handle local claims", e); } return claimManager; }
private String getAuthorizationCode(HttpServletRequest request) throws ApplicationAuthenticatorException { OAuthAuthzResponse authzResponse; try { authzResponse = OAuthAuthzResponse.oauthCodeAuthzResponse(request); return authzResponse.getCode(); } catch (OAuthProblemException e) { throw new ApplicationAuthenticatorException("Exception while reading authorization code.", e); } }
private UserRealm getUserRealm(String tenantDomain) throws PostAuthenticationFailedException { UserRealm realm; try { realm = AnonymousSessionUtil.getRealmByTenantDomain( FrameworkServiceComponent.getRegistryService(), FrameworkServiceComponent.getRealmService(), tenantDomain); } catch (CarbonException e) { throw new PostAuthenticationFailedException("Error while handling missing mandatory claims", "Error occurred while retrieving the Realm for " + tenantDomain + " to handle local claims", e); } return realm; }
private ClaimManager getClaimManager(String tenantDomain, UserRealm realm) throws FrameworkException { ClaimManager claimManager = null; try { claimManager = realm.getClaimManager(); } catch (UserStoreException e) { throw new FrameworkException("Error occurred while retrieving the ClaimManager " + "from Realm for " + tenantDomain + " to handle local claims", e); } return claimManager; }
private UserRealm getUserRealm(String tenantDomain) throws PostAuthenticationFailedException { UserRealm realm; try { realm = AnonymousSessionUtil.getRealmByTenantDomain( FrameworkServiceComponent.getRegistryService(), FrameworkServiceComponent.getRealmService(), tenantDomain); } catch (CarbonException e) { throw new PostAuthenticationFailedException("Error while handling missing mandatory claims", "Error occurred while retrieving the Realm for " + tenantDomain + " to handle local claims", e); } return realm; }
private ClaimManager getClaimManager(String tenantDomain, UserRealm realm) throws FrameworkException { ClaimManager claimManager = null; try { claimManager = realm.getClaimManager(); } catch (UserStoreException e) { throw new FrameworkException("Error occurred while retrieving the ClaimManager " + "from Realm for " + tenantDomain + " to handle local claims", e); } return claimManager; }
private String getStandardClaimURIFromLocal(String standardDialect, String tenantDomain, String claimURI) throws FrameworkException { try { Map<String, String> claimMapping = ClaimMetadataHandler.getInstance() .getMappingsMapFromOtherDialectToCarbon(standardDialect, null, tenantDomain, true); if (claimMapping.containsKey(claimURI)) { return claimMapping.get(claimURI); } } catch (ClaimMetadataException e) { throw new FrameworkException("Error while loading mappings.", e); } return null; }
public static BundleContext getBundleContext() throws FrameworkException { BundleContext bundleContext = FrameworkServiceDataHolder.getInstance().getBundleContext(); if (bundleContext == null) { String msg = "System has not been started properly. Bundle Context is null."; log.error(msg); throw new FrameworkException(msg); } return bundleContext; }
private UserRealm getUserRealm(String tenantDomain) throws FrameworkException { UserRealm realm; try { realm = AnonymousSessionUtil.getRealmByTenantDomain( FrameworkServiceComponent.getRegistryService(), FrameworkServiceComponent.getRealmService(), tenantDomain); } catch (CarbonException e) { throw new FrameworkException("Error occurred while retrieving the Realm for " + tenantDomain + " to handle local claims", e); } return realm; }
private UserRealm getUserRealm(String tenantDomain) throws FrameworkException { UserRealm realm; try { realm = AnonymousSessionUtil.getRealmByTenantDomain( FrameworkServiceComponent.getRegistryService(), FrameworkServiceComponent.getRealmService(), tenantDomain); } catch (CarbonException e) { throw new FrameworkException("Error occurred while retrieving the Realm for " + tenantDomain + " to handle local claims", e); } return realm; }
private UserRealm getUserRealm(String tenantDomain) throws FrameworkException { UserRealm realm; try { realm = AnonymousSessionUtil.getRealmByTenantDomain( FrameworkServiceComponent.getRegistryService(), FrameworkServiceComponent.getRealmService(), tenantDomain); } catch (CarbonException e) { throw new FrameworkException("Error occurred while retrieving the Realm for " + tenantDomain + " to handle local claims", e); } return realm; }
private UserRealm getUserRealm(String tenantDomain) throws FrameworkException { UserRealm realm; try { realm = AnonymousSessionUtil.getRealmByTenantDomain(UserFunctionsServiceHolder.getInstance() .getRegistryService(), UserFunctionsServiceHolder.getInstance().getRealmService(), tenantDomain); } catch (CarbonException e) { throw new FrameworkException( "Error occurred while retrieving the Realm for " + tenantDomain + " to retrieve user roles", e); } return realm; }
private UserRealm getUserRealm(String tenantDomain) throws FrameworkException { UserRealm realm; try { realm = AnonymousSessionUtil.getRealmByTenantDomain(UserFunctionsServiceHolder.getInstance() .getRegistryService(), UserFunctionsServiceHolder.getInstance().getRealmService(), tenantDomain); } catch (CarbonException e) { throw new FrameworkException( "Error occurred while retrieving the Realm for " + tenantDomain + " to retrieve user roles", e); } return realm; }