Examples of CredentialsCallback


Examples of org.apache.jackrabbit.core.security.CredentialsCallback

        if (this.callbackHandler == null) {
            throw new LoginException("no CallbackHandler available");
        }

        Callback[] callbacks = new Callback[]{
            new CredentialsCallback()
        };
       
        this.principals.clear();
        try {
            //Calls setCredentials() on the callbacks
            this.callbackHandler.handle(callbacks);
            CredentialsCallback ccb = (CredentialsCallback) callbacks[0];
            Credentials creds = ccb.getCredentials();
             
            if (creds != null && creds instanceof SimpleCredentials) {
               
                final SimpleCredentials sc = (SimpleCredentials) creds;
               
View Full Code Here

Examples of org.apache.jackrabbit.core.security.CredentialsCallback

    {
      throw new LoginException("no CallbackHandler available");
    }

    Callback[] callbacks = new Callback[]
    { new CredentialsCallback() };

    boolean authenticated = false;
    principals.clear();
    try
    {
      callbackHandler.handle(callbacks);
      // credentials
      CredentialsCallback ccb = (CredentialsCallback) callbacks[0];
      Credentials creds = ccb.getCredentials();
      if (creds != null)
      {
        if (creds instanceof SimpleCredentials)
        {
          SimpleCredentials sc = (SimpleCredentials) creds;
View Full Code Here

Examples of org.apache.jackrabbit.core.security.authentication.CredentialsCallback

     * @throws UnsupportedCallbackException
     * @throws IOException
     */
    private Credentials getCredentials() throws IOException,
            UnsupportedCallbackException {
        CredentialsCallback credentialsCallback = new CredentialsCallback();
        callbackHandler.handle(new Callback[] { credentialsCallback });
        return credentialsCallback.getCredentials();
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.security.authentication.CredentialsCallback

     */
    @Override
    protected Credentials getCredentials() {
        Credentials creds = super.getCredentials();
        if ( creds == null ) {
            CredentialsCallback callback = new CredentialsCallback();
            try {
                pluggableCallackHander.handle(new Callback[]{callback});
                Credentials callbackCreds = callback.getCredentials();
                if ( callbackCreds instanceof TrustedCredentials ) {
                    creds = callbackCreds;
                }
            } catch (UnsupportedCallbackException e) {
                log.warn("Credentials-Callback not supported try Name-Callback");
View Full Code Here

Examples of org.apache.jackrabbit.core.security.authentication.CredentialsCallback

    private Credentials getCredentials() throws LoginException {
        if (callbackHandler == null) {
            throw new LoginException("Null callback handler");
        }

        CredentialsCallback ccb = new CredentialsCallback();
        try {
            callbackHandler.handle(new Callback[]{ccb});
        } catch (Exception e) {
            throw new LoginException("Failed to retrieve login credentials");
        }
        return ccb.getCredentials();
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.security.authentication.CredentialsCallback

    }

    @Override
    public boolean login() throws LoginException {
        if (callbackHandler != null) {
            CredentialsCallback ccb = new CredentialsCallback();
            try {
                callbackHandler.handle(new Callback[] {ccb});
                Credentials credentials = ccb.getCredentials();
                if (credentials == null) {
                    Set<Credentials> sharedCredentials;
                    Object sharedObj = sharedState.get(LoginModuleImpl.SHARED_KEY_CREDENTIALS);
                    if (sharedObj == null || !(sharedObj instanceof Set)) {
                        sharedCredentials = new HashSet<Credentials>();
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.security.authentication.CredentialsCallback

        credentials.addAll(getSharedCredentials());

        if (callbackHandler != null) {
            log.debug("Login: retrieving Credentials using callback.");
            try {
                CredentialsCallback callback = new CredentialsCallback();
                callbackHandler.handle(new Callback[]{callback});
                Credentials creds = callback.getCredentials();
                if (creds != null) {
                    log.debug("Login: Credentials '{}' obtained from callback", creds);
                    credentials.add(creds);
                }
            } catch (UnsupportedCallbackException e) {
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.security.authentication.CredentialsCallback

    }

    @Override
    public boolean login() throws LoginException {
        if (callbackHandler != null) {
            CredentialsCallback ccb = new CredentialsCallback();
            try {
                callbackHandler.handle(new Callback[] {ccb});
                Credentials credentials = ccb.getCredentials();
                if (credentials == null) {
                    guestCredentials = new GuestCredentials();
                    sharedState.put(AbstractLoginModule.SHARED_KEY_CREDENTIALS, guestCredentials);
                    return true;
                }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.security.authentication.callback.CredentialsCallback

    protected Credentials getCredentials() {
        Set<Class> supported = getSupportedCredentials();
        if (callbackHandler != null) {
            log.debug("Login: retrieving Credentials using callback.");
            try {
                CredentialsCallback callback = new CredentialsCallback();
                callbackHandler.handle(new Callback[]{callback});
                Credentials creds = callback.getCredentials();
                if (creds != null && supported.contains(creds.getClass())) {
                    log.debug("Login: Credentials '{}' obtained from callback", creds);
                    return creds;
                } else {
                    log.debug("Login: No supported credentials obtained from callback; trying shared state.");
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.security.authentication.callback.CredentialsCallback

    protected Credentials getCredentials() {
        Set<Class> supported = getSupportedCredentials();
        if (callbackHandler != null) {
            log.debug("Login: retrieving Credentials using callback.");
            try {
                CredentialsCallback callback = new CredentialsCallback();
                callbackHandler.handle(new Callback[]{callback});
                Credentials creds = callback.getCredentials();
                if (creds != null && supported.contains(creds.getClass())) {
                    log.debug("Login: Credentials '{}' obtained from callback", creds);
                    return creds;
                } else {
                    log.debug("Login: No supported credentials obtained from callback; trying shared state.");
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.