Search in sources :

Example 1 with UserAuthKeyboardInteractiveFactory

use of org.apache.sshd.server.auth.keyboard.UserAuthKeyboardInteractiveFactory in project karaf by apache.

the class UserAuthFactoriesFactory method setAuthMethods.

public void setAuthMethods(String[] methods) {
    this.methodSet = new HashSet<>();
    this.factories = new ArrayList<>();
    for (String am : methods) {
        if (PASSWORD_METHOD.equals(am)) {
            this.factories.add(new UserAuthPasswordFactory());
        } else if (KEYBOARD_INTERACTIVE_METHOD.equals(am)) {
            this.factories.add(new UserAuthKeyboardInteractiveFactory());
        } else if (PUBLICKEY_METHOD.equals(am)) {
            this.factories.add(new UserAuthPublicKeyFactory());
        } else {
            throw new IllegalArgumentException("Invalid authentication method " + am + " specified");
        }
        this.methodSet.add(am);
    }
}
Also used : UserAuthPasswordFactory(org.apache.sshd.server.auth.password.UserAuthPasswordFactory) UserAuthPublicKeyFactory(org.apache.sshd.server.auth.pubkey.UserAuthPublicKeyFactory) UserAuthKeyboardInteractiveFactory(org.apache.sshd.server.auth.keyboard.UserAuthKeyboardInteractiveFactory)

Aggregations

UserAuthKeyboardInteractiveFactory (org.apache.sshd.server.auth.keyboard.UserAuthKeyboardInteractiveFactory)1 UserAuthPasswordFactory (org.apache.sshd.server.auth.password.UserAuthPasswordFactory)1 UserAuthPublicKeyFactory (org.apache.sshd.server.auth.pubkey.UserAuthPublicKeyFactory)1