/** * @param request An instance of OpenIDAuthenticationRequest */ public OpenIDAttributeExchange(OpenIDAuthenticationRequest request) throws IdentityException { if (request == null) { log.debug("Request cannot be null while initializing OpenIDAttributeExchange"); throw IdentityException.error("Request cannot be null while initializing OpenIDAttributeExchange"); } this.openidAuthnRequest = request; }
/** * @param request An instance of OpenIDAuthenticationRequest */ public OpenIDPape(OpenIDAuthenticationRequest request) throws IdentityException { if (request == null) { log.debug("Request cannot be null while initializing OpenIDPape"); throw IdentityException.error("Request cannot be null while initializing OpenIDPape"); } this.request = request; }
/** * @param request An instance of OpenIDAuthenticationRequest */ public OpenIDSimpleReg(OpenIDAuthenticationRequest request) throws IdentityException { if (request == null) { log.debug("Request cannot be null while initializing OpenIDSimpleReg"); throw IdentityException.error("Request cannot be null while initializing OpenIDSimpleReg"); } this.request = request; }
/** * Creates an IdentityException instance wrapping the given error message and * * @param message Error message * @param e Exception * @throws IdentityException constructed exception based on input parameters */ private void getException(String message, Exception e) throws IdentityException { log.error(message, e); throw IdentityException.error(message, e); } }
/** * Creates an IdentityException instance wrapping the given error message and * * @param message Error message * @param e Exception * @throws IdentityException */ private void getException(String message, Exception e) throws IdentityException { log.error(message, e); throw IdentityException.error(message, e); } }
@SuppressWarnings("deprecation") public static Registry getRegistry() throws IdentityException { try { return AdminServicesUtil.getSystemRegistry(); } catch (CarbonException e) { log.error("Error obtaining a registry instance", e); throw IdentityException.error("Error obtaining a registry instance", e); } }
@SuppressWarnings("deprecation") public static Registry getRegistry() throws IdentityException { try { return AdminServicesUtil.getSystemRegistry(); } catch (CarbonException e) { log.error("Error obtaining a registry instance", e); throw IdentityException.error("Error obtaining a registry instance", e); } }
public boolean isServiceProviderExists(String issuer) throws IdentityException { String path = IdentityRegistryResources.SAML_SSO_SERVICE_PROVIDERS + encodePath(issuer); try { return registry.resourceExists(path); } catch (RegistryException e) { throw IdentityException.error("Error occurred while checking if resource path \'" + path + "\' exists in " + "registry"); } }
public boolean isServiceProviderExists(String issuer) throws IdentityException { String path = IdentityRegistryResources.SAML_SSO_SERVICE_PROVIDERS + encodePath(issuer); try { return registry.resourceExists(path); } catch (RegistryException e) { throw IdentityException.error("Error occurred while checking if resource path \'" + path + "\' exists in " + "registry"); } }
public static IdentityRecoveryClientException handleClientException(IdentityRecoveryConstants.ErrorMessages error, String data, Throwable e) throws IdentityRecoveryClientException { String errorDescription; if (StringUtils.isNotBlank(data)) { errorDescription = String.format(error.getMessage(), data); } else { errorDescription = error.getMessage(); } return IdentityException.error(IdentityRecoveryClientException.class, error.getCode(), errorDescription, e); }
public static IdentityOAuth2ScopeServerException generateServerException(Oauth2ScopeConstants.ErrorMessages error, String data) throws IdentityOAuth2ScopeServerException { String errorDescription; if (StringUtils.isNotBlank(data)) { errorDescription = String.format(error.getMessage(), data); } else { errorDescription = error.getMessage(); } return IdentityException.error( IdentityOAuth2ScopeServerException.class, error.getCode(), errorDescription); }
public static DCRMServerException generateServerException(DCRMConstants.ErrorMessages error, String data) throws DCRMServerException { String errorDescription; if (StringUtils.isNotBlank(data)) { errorDescription = String.format(error.getMessage(), data); } else { errorDescription = error.getMessage(); } return IdentityException.error(DCRMServerException.class, error.toString(), errorDescription); }
public static DCRMClientException generateClientException(DCRMConstants.ErrorMessages error, String data, Throwable e) throws DCRMClientException { String errorDescription; if (StringUtils.isNotBlank(data)) { errorDescription = String.format(error.getMessage(), data); } else { errorDescription = error.getMessage(); } return IdentityException.error(DCRMClientException.class, error.toString(), errorDescription, e); }
public static IdentityOAuth2ScopeServerException generateServerException(Oauth2ScopeConstants.ErrorMessages error, Throwable e) throws IdentityOAuth2ScopeServerException { return IdentityException.error( IdentityOAuth2ScopeServerException.class, error.getCode(), error.getMessage(), e); }
public static IdentityRecoveryServerException handleServerException(IdentityRecoveryConstants.ErrorMessages error, String data) throws IdentityRecoveryServerException { String errorDescription; if (StringUtils.isNotBlank(data)) { errorDescription = String.format(error.getMessage(), data); } else { errorDescription = error.getMessage(); } return IdentityException.error( IdentityRecoveryServerException.class, error.getCode(), errorDescription); }
public static IdentityRecoveryClientException handleClientException(IdentityRecoveryConstants.ErrorMessages error, String data) throws IdentityRecoveryClientException { String errorDescription; if (StringUtils.isNotBlank(data)) { errorDescription = String.format(error.getMessage(), data); } else { errorDescription = error.getMessage(); } return IdentityException.error(IdentityRecoveryClientException.class, error.getCode(), errorDescription); }
public static DCRMClientException generateClientException(DCRMConstants.ErrorMessages error, String data) throws DCRMClientException { String errorDescription; if (StringUtils.isNotBlank(data)) { errorDescription = String.format(error.getMessage(), data); } else { errorDescription = error.getMessage(); } return IdentityException.error(DCRMClientException.class, error.toString(), errorDescription); }
public static UserDTO processUserId(String userId) throws IdentityException { if (userId == null || userId.trim().length() < 1) { throw IdentityException.error("Can not proceed with out a user id"); } UserDTO userDTO = new UserDTO(userId); if (!IdentityMgtConfig.getInstance().isSaasEnabled()) { validateTenant(userDTO); } userDTO.setTenantId(getTenantId(userDTO.getTenantDomain())); return userDTO; }
public static void validateTenant(UserDTO user) throws IdentityException { if (user.getTenantDomain() != null && !user.getTenantDomain().isEmpty()) { if (!user.getTenantDomain().equals( PrivilegedCarbonContext.getThreadLocalCarbonContext() .getTenantDomain())) { throw IdentityException.error( "Failed access to unauthorized tenant domain"); } user.setTenantId(getTenantId(user.getTenantDomain())); } }
@Override public void invalidate(String userId, int tenantId) throws IdentityException { Registry registry = null; try { registry = IdentityMgtServiceComponent.getRegistryService(). getConfigSystemRegistry(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId()); deleteOldResourcesIfFound(registry, userId, IdentityMgtConstants.IDENTITY_MANAGEMENT_DATA); } catch (RegistryException e) { throw IdentityException.error("Error while deleting the old confirmation code.", e); } }