Examples of InfoCardSignInDTO


Examples of org.wso2.carbon.identity.relyingparty.dto.InfoCardSignInDTO

        HttpServletRequest request =
                                     (HttpServletRequest) msgCtx.
                                                                 getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
        HttpSession httpSess = request.getSession();
        Hashtable<String, String> attributes = null;
        InfoCardSignInDTO dto = new InfoCardSignInDTO();

        ByteArrayInputStream bais = new ByteArrayInputStream(infocard.getXmlToken().getBytes());
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        Document doc = dbf.newDocumentBuilder().parse(bais);
        Element token = doc.getDocumentElement();
        boolean isAuthenticated = false;

        if (verifier.verifyDecryptedToken(token, RelyingPartyData.getInstance())) {
            attributes = verifier.getAttributeTable();
            String ppid = null;
            String user = null;
            if (validateIssuerInfoPolicy(verifier, RelyingPartyData.getInstance())) {
                ppid = attributes.get(IdentityConstants.CLAIM_PPID);
                String uri = request.getRequestURI();
                user = getUserName(ppid, uri);
                if (IdentityConstants.SELF_ISSUED_ISSUER.equals(verifier.getIssuerName())) {
                    dto.setPpid(ppid);
                }
                String domain =
                                UserCoreUtil.getTenantDomain(
                                                             IdentityRPServiceComponent.getRealmService(),
                                                             user);
                int tenantId = IdentityRPServiceComponent.getRealmService().getTenantManager().
                                                          getTenantId(domain);
                CarbonAuthenticationUtil.onSuccessAdminLogin(httpSess, user, tenantId, domain,
                                                             request.getRemoteHost());
                isAuthenticated = true;
                dto.setAuthenticated(true);
                dto.setUserID(user);
            }
        }

        if (!isAuthenticated) {
            CarbonAuthenticationUtil.onFailedAdminLogin(httpSess, null, -1,
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.