Package org.jboss.as.domain.management.security

Examples of org.jboss.as.domain.management.security.DomainCallbackHandler


    public AuthenticationProvider(final SecurityRealm securityRealm) {
        this.securityRealm = securityRealm;
    }

    AuthorizingCallbackHandler getCallbackHandler() {
        final DomainCallbackHandler callbackHandler = securityRealm.getCallbackHandler();

        return new AuthorizingCallbackHandler() {

            Subject subject;

            @Override
            public Class<Callback>[] getSupportedCallbacks() {
                return callbackHandler.getSupportedCallbacks();
            }

            @Override
            public boolean isReady() {
                return callbackHandler.isReady();
            }

            public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
                if (contains(SubjectCallback.class, callbackHandler.getSupportedCallbacks())) {
                    Callback[] newCallbacks = new Callback[callbacks.length + 1];
                    System.arraycopy(callbacks, 0, newCallbacks, 0, callbacks.length);
                    SubjectCallback subjectCallBack = new SubjectCallback();
                    newCallbacks[newCallbacks.length - 1] = subjectCallBack;
                    callbackHandler.handle(newCallbacks);
                    subject = subjectCallBack.getSubject();
                } else {
                    callbackHandler.handle(callbacks);
                }
            }

            @Override
            public SubjectUserInfo createSubjectUserInfo(Principal userPrincipal) throws IOException {
View Full Code Here


        // any redirects.
        if (authenticator != null) {
            context.setAuthenticator(authenticator);
            List<Filter> filters = context.getFilters();
            if (securityRealm.hasTrustStore() == false) {
                DomainCallbackHandler callbackHandler = securityRealm.getCallbackHandler();
                filters.add(new RealmReadinessFilter(callbackHandler, ErrorHandler.getRealmRedirect()));
            }
        }
    }
View Full Code Here

         */
        @Override
        public void start(HttpServer httpServer, SecurityRealm securityRealm) {
            HttpContext httpContext = httpServer.createContext(getContext(), this);
            if (securityRealm != null) {
                DomainCallbackHandler domainCBH = securityRealm.getCallbackHandler();
                httpContext.getFilters().add(new RealmReadinessFilter(domainCBH, ErrorHandler.getRealmRedirect()));
            }
        }
View Full Code Here

        Authenticator auth = null;
        final CertAuth certAuthMode;

        if (securityRealm != null) {
            DomainCallbackHandler callbackHandler = securityRealm.getCallbackHandler();
            Class<Callback>[] supportedCallbacks = callbackHandler.getSupportedCallbacks();
            if (DigestAuthenticator.requiredCallbacksSupported(supportedCallbacks)) {
                auth = new DigestAuthenticator(new AuthenticationProvider(securityRealm), securityRealm.getName(), contains(DigestHashCallback.class,
                        supportedCallbacks));
            } else if (BasicAuthenticator.requiredCallbacksSupported(supportedCallbacks)) {
                auth = new BasicAuthenticator(new AuthenticationProvider(securityRealm), securityRealm.getName());
View Full Code Here

        // Once there is a trust store we can no longer rely on users being defined so skip
        // any redirects.
        if (authenticator != null) {
            context.setAuthenticator(authenticator);
            if (securityRealm.hasTrustStore() == false) {
                DomainCallbackHandler callbackHandler = securityRealm.getCallbackHandler();
                context.getFilters().add(new RealmReadinessFilter(callbackHandler, ErrorHandler.getRealmRedirect()));
            }
        }
    }
View Full Code Here

        Authenticator auth = null;
        final CertAuth certAuthMode;

        if (securityRealm != null) {
            DomainCallbackHandler callbackHandler = securityRealm.getCallbackHandler();
            Class[] supportedCallbacks = callbackHandler.getSupportedCallbacks();
            if (DigestAuthenticator.requiredCallbacksSupported(supportedCallbacks)) {
                auth = new DigestAuthenticator(callbackHandler, securityRealm.getName(), contains(DigestHashCallback.class,
                        supportedCallbacks));
            } else if (BasicAuthenticator.requiredCallbacksSupported(supportedCallbacks)) {
                auth = new BasicAuthenticator(callbackHandler, securityRealm.getName());
View Full Code Here

         */
        @Override
        public void start(HttpServer httpServer, SecurityRealm securityRealm) {
            HttpContext httpContext = httpServer.createContext(getContext(), this);
            if (securityRealm != null) {
                DomainCallbackHandler domainCBH = securityRealm.getCallbackHandler();
                httpContext.getFilters().add(new RealmReadinessFilter(domainCBH, ErrorHandler.getRealmRedirect()));
            }
        }
View Full Code Here

        Authenticator auth = null;
        final CertAuth certAuthMode;

        if (securityRealm != null) {
            DomainCallbackHandler callbackHandler = securityRealm.getCallbackHandler();
            Class<Callback>[] supportedCallbacks = callbackHandler.getSupportedCallbacks();
            if (DigestAuthenticator.requiredCallbacksSupported(supportedCallbacks)) {
                auth = new DigestAuthenticator(new AuthenticationProvider(securityRealm), securityRealm.getName(), contains(DigestHashCallback.class,
                        supportedCallbacks));
            } else if (BasicAuthenticator.requiredCallbacksSupported(supportedCallbacks)) {
                auth = new BasicAuthenticator(new AuthenticationProvider(securityRealm), securityRealm.getName());
View Full Code Here

    }

    public void start(HttpServer httpServer, SecurityRealm securityRealm) {
        HttpContext context = httpServer.createContext(DOMAIN_API_CONTEXT, this);
        if (securityRealm != null) {
            DomainCallbackHandler callbackHandler = securityRealm.getCallbackHandler();
            Class[] supportedCallbacks = callbackHandler.getSupportedCallbacks();
            if (DigestAuthenticator.requiredCallbacksSupported(supportedCallbacks)) {
                context.setAuthenticator(new DigestAuthenticator(callbackHandler, securityRealm.getName(), contains(DigestHashCallback.class, supportedCallbacks)));
            } else if (BasicAuthenticator.requiredCallbacksSupported(supportedCallbacks)) {
                context.setAuthenticator(new BasicAuthenticator(callbackHandler, securityRealm.getName()));
            }
View Full Code Here

    @Override
    public void start(HttpServer httpServer, SecurityRealm securityRealm) {
        HttpContext httpContext = httpServer.createContext(CONTEXT, this);
        if (securityRealm != null) {
            DomainCallbackHandler domainCBH = securityRealm.getCallbackHandler();
            httpContext.getFilters().add(new RealmReadinessFilter(domainCBH, ERROR_CONTEXT));
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.domain.management.security.DomainCallbackHandler

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.