Package org.apache.geronimo.security.realm.providers

Examples of org.apache.geronimo.security.realm.providers.PasswordCallbackHandler


        this.configurationFactory = configurationFactory;
        this.identityService = identityService;
    }

    public UserIdentity login(String userName, String password) {
        return login(new PasswordCallbackHandler(userName, password.toCharArray()));
    }
View Full Code Here


        return realmName;
    }

    public UserIdentity login(String username, Object credentials) {
        char[] password = credentials instanceof  String? ((String)credentials).toCharArray(): (char[]) credentials;
        CallbackHandler callbackHandler = new PasswordCallbackHandler(username, password);
        try {
            LoginContext loginContext = ContextManager.login(configurationFactory.getConfigurationName(), callbackHandler, configurationFactory.getConfiguration());
            Subject establishedSubject = loginContext.getSubject();
            Principal userPrincipal = ContextManager.getCurrentPrincipal(establishedSubject);
            return identityService.newUserIdentity(establishedSubject, userPrincipal, null);
View Full Code Here

                }

                ClearableCallbackHandler callbackHandler;
                if (credentials instanceof char[]) {
                    char[] password = (char[]) credentials;
                    callbackHandler = new PasswordCallbackHandler(username, password);
                } else if (credentials instanceof String) {
                    char[] password = ((String) credentials).toCharArray();
                    callbackHandler = new PasswordCallbackHandler(username, password);
                } else if (credentials instanceof X509Certificate[]) {
                    X509Certificate[] certs = (X509Certificate[]) credentials;
                    if (certs.length < 1) {
                        throw new LoginException("no certificates supplied");
                    }
View Full Code Here

     *            username
     */
    public Principal authenticate(String username, String credentials) {

        char[] cred = credentials == null ? null : credentials.toCharArray();
        CallbackHandler callbackHandler = new PasswordCallbackHandler(username, cred);
        return authenticate(callbackHandler, username);
    }
View Full Code Here

            }

            ClearableCallbackHandler callbackHandler;
            if (credentials instanceof char[]) {
                char[] password = (char[]) credentials;
                callbackHandler = new PasswordCallbackHandler(username, password);
            } else if (credentials instanceof String) {
                char[] password = ((String) credentials).toCharArray();
                callbackHandler = new PasswordCallbackHandler(username, password);
            } else if (credentials instanceof X509Certificate[]) {
                X509Certificate[] certs = (X509Certificate[]) credentials;
                if (certs.length < 1) {
                    throw new LoginException("no certificates supplied");
                }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.security.realm.providers.PasswordCallbackHandler

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.