/** * @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; }
@Deprecated public static IdentityException error(String errorDescription, Throwable cause) { IdentityException identityException = new IdentityException(errorDescription, cause); // ErrorInfo.ErrorInfoBuilder errorInfoBuilder = new ErrorInfo.ErrorInfoBuilder(errorDescription); // errorInfoBuilder.cause(cause); // identityException.addErrorInfo(errorInfoBuilder.build()); return identityException; }
public String[] getIssuersOfSAMLServiceProviders() { try { return SAMLValidatorUtil.getIssuersOfSAMLServiceProviders(); } catch (IdentityException e) { if (log.isDebugEnabled()) { log.debug(e.getMessage()); } } return null; }
private String getDefaultErrorCode() { String errorCode = super.getErrorCode(); if (StringUtils.isEmpty(errorCode)) { //TODO define error codes for DCRM // errorCode = Oauth2ScopeConstants.ErrorMessages.ERROR_CODE_UNEXPECTED.getCode(); } return errorCode; }
private String getDefaultErrorCode() { String errorCode = super.getErrorCode(); if (StringUtils.isEmpty(errorCode)) { errorCode = IdentityRecoveryConstants.ErrorMessages.ERROR_CODE_UNEXPECTED.getCode(); } return errorCode; }
/** * @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; }
@Deprecated public static IdentityException error(String errorDescription) { IdentityException identityException = new IdentityException(errorDescription); // ErrorInfo.ErrorInfoBuilder errorInfoBuilder = new ErrorInfo.ErrorInfoBuilder(errorDescription); // identityException.addErrorInfo(errorInfoBuilder.build()); return identityException; }
public String[] getIssuersOfSAMLServiceProviders() { try { return SAMLValidatorUtil.getIssuersOfSAMLServiceProviders(); } catch (IdentityException e) { if (log.isDebugEnabled()) { log.debug(e.getMessage()); } } return null; }
private String getDefaultErrorCode() { String errorCode = super.getErrorCode(); if (StringUtils.isEmpty(errorCode)) { errorCode = Oauth2ScopeConstants.ErrorMessages.ERROR_CODE_UNEXPECTED.getCode(); } return errorCode; }
/** * @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; }
@Deprecated public static IdentityException error(String message) { return new IdentityException(message); } @Deprecated
public static UserChallengesDTO getCustomErrorMessagesForChallengQuestions(IdentityException e, String userName) { if (e.getMessage() != null) { if (e.getMessage().contains(VerificationBean.ERROR_CODE_EXPIRED_CODE)) { userChallengesDTO = handleChallengesError(VerificationBean.ERROR_CODE_EXPIRED_CODE + " The code is " + "expired", e); } else if (e.getMessage().contains(IdentityMgtConstants.ErrorHandling.INVALID_CONFIRMATION_CODE)) { userChallengesDTO = handleChallengesError(VerificationBean.ERROR_CODE_INVALID_CODE + " " + IdentityMgtConstants.ErrorHandling.INVALID_CONFIRMATION_CODE, e); } else if (e.getMessage().contains(VerificationBean.ERROR_CODE_LOADING_DATA_FAILURE)) { userChallengesDTO = handleChallengesError(VerificationBean.ERROR_CODE_LOADING_DATA_FAILURE + " Error" + " loading data for user : " + userName, e); } else if (e.getMessage().contains(IdentityMgtConstants.ErrorHandling.EXTERNAL_CODE)) { userChallengesDTO = handleChallengesError(VerificationBean.ERROR_CODE_INVALID_CODE + " " + IdentityMgtConstants.ErrorHandling.EXTERNAL_CODE + ": " + userName, e); } return userChallengesDTO; } else { userChallengesDTO = handleChallengesError(VerificationBean.ERROR_CODE_INVALID_CODE + " " + IdentityMgtConstants.ErrorHandling.EXTERNAL_CODE + ": " + userName, e); return userChallengesDTO; } }
/** * 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); } }
@Deprecated public static IdentityException error(String errorCode, String message) { return new IdentityException(errorCode, message); } @Deprecated
public static UserChallengesDTO getCustomErrorMessagesForChallengQuestions(IdentityException e, String userName) { if (e.getMessage() != null) { if (e.getMessage().contains(VerificationBean.ERROR_CODE_EXPIRED_CODE)) { userChallengesDTO = handleChallengesError(VerificationBean.ERROR_CODE_EXPIRED_CODE + " The code is " + "expired", e); } else if (e.getMessage().contains(IdentityMgtConstants.ErrorHandling.INVALID_CONFIRMATION_CODE)) { userChallengesDTO = handleChallengesError(VerificationBean.ERROR_CODE_INVALID_CODE + " " + IdentityMgtConstants.ErrorHandling.INVALID_CONFIRMATION_CODE, e); } else if (e.getMessage().contains(VerificationBean.ERROR_CODE_LOADING_DATA_FAILURE)) { userChallengesDTO = handleChallengesError(VerificationBean.ERROR_CODE_LOADING_DATA_FAILURE + " Error" + " loading data for user : " + userName, e); } else if (e.getMessage().contains(IdentityMgtConstants.ErrorHandling.EXTERNAL_CODE)) { userChallengesDTO = handleChallengesError(VerificationBean.ERROR_CODE_INVALID_CODE + " " + IdentityMgtConstants.ErrorHandling.EXTERNAL_CODE + ": " + userName, e); } return userChallengesDTO; } else { userChallengesDTO = handleChallengesError(VerificationBean.ERROR_CODE_INVALID_CODE + " " + IdentityMgtConstants.ErrorHandling.EXTERNAL_CODE + ": " + userName, e); return userChallengesDTO; } }
/** * 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); } }
@Deprecated public static IdentityException error(String message, Throwable cause) { return new IdentityException(message, cause); } @Deprecated
@Override public void removeServiceProviderConfiguration(String issuer) throws IdentityApplicationManagementException { try { IdentityPersistenceManager persistenceManager = IdentityPersistenceManager.getPersistanceManager(); Registry configSystemRegistry = (Registry) PrivilegedCarbonContext.getThreadLocalCarbonContext(). getRegistry(RegistryType.SYSTEM_CONFIGURATION); persistenceManager.removeServiceProvider(configSystemRegistry, issuer); } catch (IdentityException e) { log.error("Erro while deleting the issuer", e); throw new IdentityApplicationManagementException("Error while deleting SAML issuer " + e.getMessage()); } }
/** * @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; }
@Deprecated public static IdentityException error(String errorCode, String message, Throwable cause) { return new IdentityException(errorCode, message, cause); }