Examples of UserIdentity


Examples of org.apache.geronimo.tomcat.security.UserIdentity

    protected void configureSecurity(StandardContext geronimoContext, String policyContextId, ConfigurationFactory configurationFactory, Subject defaultSubject, String authMethod, String realmName, String loginPage, String errorPage) {
        if (defaultSubject == null) {
            defaultSubject = ContextManager.EMPTY;
        }
        IdentityService identityService = new GeronimoIdentityService(defaultSubject);
        UserIdentity unauthenticatedIdentity = identityService.newUserIdentity(defaultSubject, null, null);
        LoginService loginService = new GeronimoLoginService(configurationFactory, identityService);
        Authenticator authenticator;
        AuthConfigFactory authConfigFactory = AuthConfigFactory.getFactory();
        RegistrationListener listener = new RegistrationListener() {
View Full Code Here

Examples of org.apache.geronimo.tomcat.security.UserIdentity

            if (authStatus == AuthStatus.SEND_FAILURE)
                return new AuthResult(TomcatAuthStatus.SEND_FAILURE, null);

            if (authStatus == AuthStatus.SUCCESS) {
                Set<UserIdentity> ids = clientSubject.getPrivateCredentials(UserIdentity.class);
                UserIdentity userIdentity;
                if (ids.size() > 0) {
                    userIdentity = ids.iterator().next();
                } else {
                    CallerPrincipalCallback principalCallback = callbackHandler.getThreadCallerPrincipalCallback();
                    if (principalCallback == null) throw new NullPointerException("No CallerPrincipalCallback");
View Full Code Here

Examples of org.apache.geronimo.tomcat.security.UserIdentity

                groupPrincipals.set((GroupPrincipalCallback) callback);
            } else if (callback instanceof PasswordValidationCallback) {
                PasswordValidationCallback passwordValidationCallback = (PasswordValidationCallback) callback;
                Subject subject = passwordValidationCallback.getSubject();

                UserIdentity user = loginService.login(passwordValidationCallback.getUsername(), new String(passwordValidationCallback.getPassword()));

                if (user != null) {
                    passwordValidationCallback.setResult(true);
                    passwordValidationCallback.getSubject().getPrincipals().addAll(user.getSubject().getPrincipals());
                    passwordValidationCallback.getSubject().getPrivateCredentials().add(user);
                }
            }
            // server to jaspi communication
            // TODO implement these
View Full Code Here

Examples of org.apache.geronimo.tomcat.security.UserIdentity

                }

                authorizationBC.setOffset(authorizationBC.getOffset() - 6);
            }

            UserIdentity userIdentity = loginService.login(username, password);
            if (userIdentity != null) {
                return new AuthResult(TomcatAuthStatus.SUCCESS, userIdentity);
            }
        }
View Full Code Here

Examples of org.apache.geronimo.tomcat.security.UserIdentity

    }

    public AuthResult validateRequest(Request request, Response response, boolean isAuthMandatory) throws ServerAuthException {
        String authorization = request.getHeader("authorization");
        if (authorization != null) {
            UserIdentity userIdentity = findPrincipal(request, authorization);
            if (userIdentity != null) {
                return new AuthResult(TomcatAuthStatus.SUCCESS, userIdentity);
            }
        }
View Full Code Here

Examples of org.apache.geronimo.tomcat.security.UserIdentity

    protected void configureSecurity(StandardContext geronimoContext, String policyContextId, ConfigurationFactory configurationFactory, Subject defaultSubject, String authMethod, String realmName, String loginPage, String errorPage) {
        if (defaultSubject == null) {
            defaultSubject = ContextManager.EMPTY;
        }
        IdentityService identityService = new GeronimoIdentityService(defaultSubject);
        UserIdentity unauthenticatedIdentity = identityService.newUserIdentity(defaultSubject, null, null);
        LoginService loginService = new GeronimoLoginService(configurationFactory, identityService);
        Authenticator authenticator;
        AuthConfigFactory authConfigFactory = AuthConfigFactory.getFactory();
        RegistrationListener listener = new RegistrationListener() {
View Full Code Here

Examples of org.apache.geronimo.tomcat.security.UserIdentity

//                        log.debug("Restore of original request failed");
                    response.sendError(HttpServletResponse.SC_BAD_REQUEST);
                    return new AuthResult(TomcatAuthStatus.SEND_FAILURE, null);
                }
            }
            UserIdentity userIdentity = (UserIdentity) session.getNote(Constants.FORM_PRINCIPAL_NOTE);
            if (userIdentity != null) {
                return new AuthResult(TomcatAuthStatus.SUCCESS, userIdentity);
            }

            //we have not yet completed authentication.
View Full Code Here

Examples of org.apache.geronimo.tomcat.security.UserIdentity

                    return new AuthResult(TomcatAuthStatus.SUCCESS, unauthenticatedIdentity);
                }
            }

            // Authenticate the specified certificate chain
            UserIdentity userIdentity = loginService.login(certs);
            if (userIdentity != null) {
                return new AuthResult(TomcatAuthStatus.SUCCESS, userIdentity);
            }
            if (isAuthMandatory) {
                response.sendError(HttpServletResponse.SC_UNAUTHORIZED,
View Full Code Here

Examples of org.eclipse.jetty.server.UserIdentity

                    return Authentication.SEND_FAILURE;

                if (authStatus == AuthStatus.SUCCESS)
                {
                Set<UserIdentity> ids = clientSubject.getPrivateCredentials(UserIdentity.class);
                    UserIdentity userIdentity;
                    if (ids.size() > 0)
                    {
                        userIdentity = ids.iterator().next();
                    } else {
                        userIdentity = _identityService.newUserIdentity(clientSubject, null, null);
View Full Code Here

Examples of org.eclipse.jetty.server.UserIdentity

    Subject subject = new Subject();

    //TODO: hardcoded to jetty - rewrite
    //*******************************************************
    DefaultIdentityService _identityService = new DefaultIdentityService();
    UserIdentity user = _identityService.newUserIdentity(subject, principal, new String[0]);
       
    Authentication cached=new HttpSessionAuthentication(session, user);
        session.setAttribute(HttpSessionAuthentication.__J_AUTHENTICATED, cached);
    //*******************************************************
     
 
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.