Package javax.security.auth.callback

Examples of javax.security.auth.callback.Callback


    public boolean login() throws LoginException {

        // Set up our CallbackHandler requests
        if (callbackHandler == null)
            throw new LoginException("No CallbackHandler specified");
        Callback callbacks[] = new Callback[2];
        callbacks[0] = new NameCallback("Username: ");
        callbacks[1] = new PasswordCallback("Password: ", false);

        // Interact with the user to retrieve the username and password
        String username = null;
View Full Code Here


        options.put(JaasLoginModuleUse.SERVERINFO_LM_OPTION, server.getServerInfo());
        Subject sub = new Subject();
        CallbackHandler handler = new CallbackHandler() {
            public void handle(Callback[] callbacks) throws UnsupportedCallbackException {
                for (int i = 0; i < callbacks.length; i++) {
                    Callback callback = callbacks[i];
                    if (callback instanceof PasswordCallback) {
                        ((PasswordCallback) callback).setPassword(password.toCharArray());
                    } else if (callback instanceof NameCallback) {
                        ((NameCallback) callback).setName(username);
                    } else {
View Full Code Here

*/
public class MagicGBallCallbackHandler implements CallbackHandler {

    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
        for (int i = 0; i < callbacks.length; i++) {
            Callback callback = callbacks[i];
            if (callback instanceof NameCallback) {
                ((NameCallback)callback).setName("system");
            } else if (callback instanceof PasswordCallback) {
                ((PasswordCallback)callback).setPassword("manager".toCharArray());
            } else {
View Full Code Here

        this.certificateChain = certificateChain;
    }

    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
        for (int i = 0; i < callbacks.length; i++) {
            Callback callback = callbacks[i];
            if (callback instanceof CertificateChainCallback) {
                CertificateChainCallback cc = (CertificateChainCallback) callback;
                cc.setCertificateChain(certificateChain);
            } else if (callback instanceof CertificateCallback
                    && certificateChain != null
View Full Code Here

        this.certificate = certificate;
    }

    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
        for (int i = 0; i < callbacks.length; i++) {
            Callback callback = callbacks[i];
            if (callback instanceof CertificateCallback) {
                CertificateCallback cc = (CertificateCallback) callback;
                cc.setCertificate(certificate);
            } else {
                throw new UnsupportedCallbackException(callback);
View Full Code Here

        this.password = password;
    }

    public void handle(Callback[] callbacks) throws UnsupportedCallbackException {
        for (int i = 0; i < callbacks.length; i++) {
            Callback callback = callbacks[i];
            if (callback instanceof NameCallback) {
                NameCallback nc = (NameCallback) callback;
                nc.setName(username);
            } else if (callback instanceof PasswordCallback) {
                PasswordCallback pc = (PasswordCallback) callback;
View Full Code Here

*/
public class MagicGBallCallbackHandler implements CallbackHandler {

    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
        for (int i = 0; i < callbacks.length; i++) {
            Callback callback = callbacks[i];
            if (callback instanceof NameCallback) {
                ((NameCallback)callback).setName("system");
            } else if (callback instanceof PasswordCallback) {
                ((PasswordCallback)callback).setPassword("manager".toCharArray());
            } else {
View Full Code Here

        options.put(JaasLoginModuleUse.SERVERINFO_LM_OPTION, server.getServerInfo());
        Subject sub = new Subject();
        CallbackHandler handler = new CallbackHandler() {
            public void handle(Callback[] callbacks) throws UnsupportedCallbackException {
                for (int i = 0; i < callbacks.length; i++) {
                    Callback callback = callbacks[i];
                    if (callback instanceof PasswordCallback) {
                        ((PasswordCallback) callback).setPassword(password.toCharArray());
                    } else if (callback instanceof NameCallback) {
                        ((NameCallback) callback).setName(username);
                    } else {
View Full Code Here

        this.password = password == null ? null : password.toCharArray();
    }

    public void handle(Callback[] callbacks) throws UnsupportedCallbackException {
        for (int i = 0; i < callbacks.length; i++) {
            Callback callback = callbacks[i];
            if (callback instanceof NameCallback) {
                NameCallback nc = (NameCallback) callback;
                nc.setName(username);
            } else if (callback instanceof PasswordCallback) {
                PasswordCallback pc = (PasswordCallback) callback;
View Full Code Here

     */
    public final void handle( Callback[] callbacks ) throws IOException, UnsupportedCallbackException
    {
        for( int i = 0; i < callbacks.length; i++ )
        {
            Callback callback = callbacks[i];
            if ( callback instanceof HttpRequestCallback )
            {
                ( (HttpRequestCallback) callback ).setRequest( m_request );
            }
            else if( callback instanceof WikiEngineCallback )
View Full Code Here

TOP

Related Classes of javax.security.auth.callback.Callback

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.