Package javax.security.auth.message.callback

Examples of javax.security.auth.message.callback.GroupPrincipalCallback


            assignGroups = false;
        }
        try {
            handler.handle((assignGroups ? new Callback[]{
                        callerPrincipalCallback,
                        new GroupPrincipalCallback(callerPrincipalCallback.getSubject(),
                        assignedGroups)} : new Callback[]{callerPrincipalCallback}));

            LOGGER.log(Level.FINE, "jmac.caller_principal:{0} {1}", new Object[]{callerPrincipalCallback.getName(), callerPrincipalCallback.getPrincipal()});
        } catch (Exception ex) {
            LOGGER.log(Level.SEVERE, "ERROR SAM!!!", ex);
View Full Code Here


        // the authentication process has been a success. We need to register the principal, username, password and roles
        // with the container
        if (result) {
            PasswordValidationCallback pvc = cbh.getPasswordValidationCallback();
            CallerPrincipalCallback cpc = cbh.getCallerPrincipalCallback();
            GroupPrincipalCallback gpc = cbh.getGroupPrincipalCallback();

            // get the client principal from the callback.
            Principal clientPrincipal = cpc.getPrincipal();
            if (clientPrincipal == null) {
                clientPrincipal = new SimplePrincipal(cpc.getName());
View Full Code Here

                        this.passwordValidationCallback = new PasswordValidationCallback(passCallback.getSubject(),
                                passCallback.getUsername(), passCallback.getPassword());
                    }
                } else if (callback instanceof GroupPrincipalCallback) {
                    if (this.groupPrincipalCallback == null) {
                        GroupPrincipalCallback groupCallback = (GroupPrincipalCallback) callback;
                        this.groupPrincipalCallback = new GroupPrincipalCallback(groupCallback.getSubject(),
                                groupCallback.getGroups());
                    }
                } else
                    WebLogger.WEB_SECURITY_LOGGER.tracef("Callback %s not supported", callback.getClass().getCanonicalName());
            }
        }
View Full Code Here

            callbacks = new Callback[] {
                    // The name of the authenticated user
                    new CallerPrincipalCallback(clientSubject, "test"),
                    // the roles of the authenticated user
                    new GroupPrincipalCallback(clientSubject, new String[] { "architect" }) };

            // Tell container to register an authentication session.
            messageInfo.getMap().put("javax.servlet.http.registerSession", TRUE.toString());
        } else {
           
View Full Code Here

        Callback[] callbacks;

        if (request.getParameter("doLogin") != null) {

            callbacks = new Callback[] { new CallerPrincipalCallback(clientSubject, "test"),
                    new GroupPrincipalCallback(clientSubject, new String[] { "architect" }) };
        } else {

            // The JASPIC protocol for "do nothing"
            callbacks = new Callback[] { new CallerPrincipalCallback(clientSubject, (Principal) null) };
        }
View Full Code Here

        try {
            response.getWriter().write("validateRequest invoked\n");

            handler.handle(new Callback[] {
                new CallerPrincipalCallback(clientSubject, "test"),
                new GroupPrincipalCallback(clientSubject, new String[] { "architect" }) });
        } catch (IOException | UnsupportedCallbackException e) {
            throw (AuthException) new AuthException().initCause(e);
        }

        return SUCCESS;
View Full Code Here

            callbacks = new Callback[] {
                // The name of the authenticated user
                new CallerPrincipalCallback(clientSubject, "test"),
                // the roles of the authenticated user
                new GroupPrincipalCallback(clientSubject, new String[] { "architect" })
            };
        } else {

            // The JASPIC protocol for "do nothing"
            callbacks = new Callback[] { new CallerPrincipalCallback(clientSubject, (Principal) null) };
View Full Code Here

            callbacks = new Callback[] {
                // The name of the authenticated user
                new CallerPrincipalCallback(clientSubject, "test"),
                // the roles of the authenticated user
                new GroupPrincipalCallback(clientSubject, new String[] { "architect" })
            };
        } else {

            // The JASPIC protocol for "do nothing"
            callbacks = new Callback[] { new CallerPrincipalCallback(clientSubject, (Principal) null) };
View Full Code Here

            throws AuthException {

        try {
            handler.handle(new Callback[] {
                new CallerPrincipalCallback(clientSubject, "test"),
                new GroupPrincipalCallback(clientSubject, new String[] { "architect" }) });
        } catch (IOException | UnsupportedCallbackException e) {
            throw (AuthException) new AuthException().initCause(e);
        }

        // Wrap the request - the resource to be invoked should get to see this
View Full Code Here

            callbacks = new Callback[] {
                // The name of the authenticated user
                new CallerPrincipalCallback(clientSubject, "test"),
                // the roles of the authenticated user
                new GroupPrincipalCallback(clientSubject, new String[] { "architect" })
            };
        } else {

            // The JASPIC protocol for "do nothing"
            callbacks = new Callback[] { new CallerPrincipalCallback(clientSubject, (Principal) null) };
View Full Code Here

TOP

Related Classes of javax.security.auth.message.callback.GroupPrincipalCallback

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.