org.keycloak.federation.kerberos.impl

## Class KerberosUsernamePasswordAuthenticator

- java.lang.Object
- - org.keycloak.federation.kerberos.impl.KerberosUsernamePasswordAuthenticator

-     public class KerberosUsernamePasswordAuthenticator
      extends Object

  Author:
    Marek Posolda

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `KerberosUsernamePasswordAuthenticator(CommonKerberosConfig config)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Subject` | `authenticateSubject(String username, String password)` Returns true if user was successfully authenticated against Kerberos
    `protected CallbackHandler` | `createJaasCallbackHandler(String principal, String password)`
    `protected Configuration` | `createJaasConfiguration()`
    `protected String` | `getKerberosPrincipal(String username)`
    `boolean` | `isUserAvailable(String username)` Returns true if user with given username exists in kerberos database
    `void` | `logoutSubject()`
    `boolean` | `validUser(String username, String password)` Returns true if user was successfully authenticated against Kerberos

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### KerberosUsernamePasswordAuthenticator

          public KerberosUsernamePasswordAuthenticator(CommonKerberosConfig config)

  - ### Method Detail

    - #### isUserAvailable

          public boolean isUserAvailable(String username)

      Returns true if user with given username exists in kerberos database
      Parameters:
        `username` - username without Kerberos realm attached or with correct realm attached
      Returns:
        true if user available

    - #### validUser

          public boolean validUser(String username,
                          String password)

      Returns true if user was successfully authenticated against Kerberos
      Parameters:
        `username` - username without Kerberos realm attached or with correct realm attached
        `password` - kerberos password
      Returns:
        true if user was successfully authenticated

    - #### authenticateSubject

          public Subject authenticateSubject(String username,
                                    String password)
                                      throws LoginException

      Returns true if user was successfully authenticated against Kerberos
      Parameters:
        `username` - username without Kerberos realm attached
        `password` - kerberos password
      Returns:
        true if user was successfully authenticated
      Throws:
        `LoginException`

    - #### logoutSubject

          public void logoutSubject()

    - #### getKerberosPrincipal

          protected String getKerberosPrincipal(String username)
                                         throws LoginException

      Throws:
        `LoginException`

    - #### createJaasCallbackHandler

          protected CallbackHandler createJaasCallbackHandler(String principal,
                                                  String password)

    - #### createJaasConfiguration

          protected Configuration createJaasConfiguration()

Copyright © 2015. All rights reserved.