Package com.sun.enterprise.security.auth.login

Examples of com.sun.enterprise.security.auth.login.AssertedCredentials


            principals[0] = PrincipalGroupFactory.getPrincipalInstance(user, realmName);

            Principal[] mappedPrincipals = mapUsers(principals);

            //  AssertedPrincipalInfo ap = new AssertedPrincipalInfo(mappedPrincipals[0].getName(), pAssrtValues, id, true);
            AssertedCredentials creds =
                    new AssertedCredentials(realmName,
                    mappedPrincipals[0].getName(), null);
            LoginContextDriver.login(creds);
            if(!rp.validateAndCacheNonce(new StringNonce(request.getCallId()))){
                throw new SecurityException("Identity Authentication failed");
            }
            SecurityContext secCtx = SecurityContext.getCurrent();
            return new WebPrincipal(creds.getUserName(), null, secCtx);          
        } catch (LoginException le) {

            securityLogger.log(Level.SEVERE, "Identity Authentication failed", le);
            throw new SecurityException("Identity Authentication failed");
View Full Code Here


        final Principal[] mappedPrincipals = this.mapUsers(principals);

        if (this.isTrusted(principals, host, messagedirection)) {

            final AssertedPrincipalInfo ap = new AssertedPrincipalInfo(mappedPrincipals[0].getName(), pAssrtValues, id, true);
            final AssertedCredentials creds = new AssertedCredentials(realmName,
                    mappedPrincipals[0].getName(), ap);
            Principal p = (Principal) AppservAccessController.doPrivileged(new PrivilegedAction() {
                public java.lang.Object run() {
                    try {
                        LoginContextDriver.login(creds);
                        SecurityContext secCtx = SecurityContext.getCurrent();
                        secCtx.getSubject().getPrivateCredentials().add(ap);
                        return new WebPrincipal(creds.getUserName(), null, secCtx);
                    } catch (LoginException ex) {
                        securityLogger.log(Level.SEVERE, "P-Asserted Authentication failed", ex);
                        throw new SecurityException("P-Asserted Authentication failed");
                    }
                }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.security.auth.login.AssertedCredentials

Copyright © 2018 www.massapicom. 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.