Examples of IdentityException


Examples of org.wso2.carbon.identity.base.IdentityException

                if(authnMode.equals(SAMLSSOConstants.AuthnModes.OPENID) && !isExistingSession){
                    AuthnRequestProcessor authnRequestProcessor = new AuthnRequestProcessor();
                    try {
                        return authnRequestProcessor.process(validationResp, sessionId, rpSessionId, authnMode);
                    } catch (Exception e) {
                        throw new IdentityException("Error processing the Authentication Request", e);
                    }
                }
                if (isExistingSession) {
                    AuthnRequestProcessor authnRequestProcessor = new AuthnRequestProcessor();
                    try {
                        return authnRequestProcessor.process(validationResp, sessionId, rpSessionId, authnMode);
                    } catch (Exception e) {
                        throw new IdentityException("Error processing the Authentication Request", e);
                    }
                }
            }
            validationResp.setRpSessionId(rpSessionId);
            return validationResp;
View Full Code Here

Examples of org.wso2.carbon.identity.base.IdentityException

        AuthnRequestProcessor authnRequestProcessor = new AuthnRequestProcessor();
        try {
            return authnRequestProcessor.process(authReqDTO, sessionId, false,
                                                 SAMLSSOConstants.AuthnModes.USERNAME_PASSWORD);
        } catch (Exception e) {
            throw new IdentityException("Error when authenticating the users", e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.identity.base.IdentityException

                } else {
                    return doOpenIDSignUp(dto.getUserName(), dto.getOpenID());
                }
            }
        } catch (Exception e) {
            throw new IdentityException(e.getMessage(), e);
        }

        return false;
    }
View Full Code Here

Examples of org.wso2.carbon.identity.base.IdentityException

        String cookie = null;
        ConfigurationContext configContext = null;
        String serverURL = null;

        if (request == null || response == null) {
            throw new IdentityException("Required attributes missing");
        }

        try {
            session = request.getSession();
            serverURL = CarbonUIUtil.getServerURL(session.getServletContext(), session);
            configContext = (ConfigurationContext) session.getServletContext().getAttribute(
                    CarbonConstants.CONFIGURATION_CONTEXT);
            cookie = (String) session.getAttribute(OpenIDAdminClient.OPENID_ADMIN_COOKIE);
            client = new OpenIDAdminClient(configContext, serverURL, cookie);

            if (OpenId.COMPLETE.equals(session.getAttribute(OpenId.ACTION))
                    || OpenId.CANCEL.equals(session.getAttribute(OpenId.ACTION))) {
                // Ready for authentication.
                paramList = (ParameterList) session.getAttribute(OpenId.PARAM_LIST);
            } else {
                // Extract the parameters from the request.Authentication not
                // completed.
                paramList = new ParameterList(request.getParameterMap());
            }

            if (paramList == null) {
                responseText = getErrorResponseText("Invalid OpenID authentication request");
                if (log.isDebugEnabled()) {
                    log.debug("Invalid OpenID authentication request :" + responseText);
                }
                directResponse(response, responseText);
                return null;
            }

            String mode = paramList.hasParameter(OpenId.ATTR_MODE) ? paramList
                    .getParameterValue(OpenId.ATTR_MODE) : null;

            if (log.isDebugEnabled()) {
                log.debug("OpenID authentication mode :" + mode);
            }

            if (OpenId.ASSOCIATE.equals(mode)) {
                responseText = client.getOpenIDAssociationResponse(OpenIDUtil
                        .getOpenIDAuthRequest(request));
                if (log.isDebugEnabled()) {
                    log.debug("Association created successfully");
                }
            } else if (OpenId.CHECKID_SETUP.equals(mode) || OpenId.CHECKID_IMMEDIATE.equals(mode)) {
                return checkSetupOrImmediate(request, paramList);
            } else if (OpenId.CHECK_AUTHENTICATION.equals(mode)) {
                responseText = client.verify(OpenIDUtil.getOpenIDAuthRequest(request));
                if (log.isDebugEnabled()) {
                    log.debug("Authentication verified successfully");
                }
            } else {
                // Error response - oops..!!! we did not get a valid OpenID
                // mode.
                responseText = getErrorResponseText("No valid OpenID found in the authentication request");
                if (log.isDebugEnabled()) {
                    log.debug("No valid OpenID found in the authentication request");
                }
            }
        } catch (Exception e) {
            responseText = getErrorResponseText(e.getMessage());
        }

        try {
            // Return the result to the user.
            directResponse(response, responseText);
        } catch (IOException e) {
            log.error(e.getMessage());
            throw new IdentityException("OpenID redirect reponse failed");
        }

        return null;
    }
View Full Code Here

Examples of org.wso2.carbon.identity.sso.saml.stub.IdentityException

                                                                                          IdentityException {
        try {
            return stub.validateRequest(authnRequest, sessionId, rpSessionId, authnMode);
        } catch (Exception e) {
            log.error("Error validating the Authentication Request", e);
            throw new IdentityException("Error in parsing authentication request", e);
//            String response = ErrorResponseBuilder.generateErrorneousResponse();
//            SAMLSSOReqValidationResponseDTO responseDTO = new SAMLSSOReqValidationResponseDTO();
//            responseDTO.setResponse(response);
//            return responseDTO;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.