org.keycloak.authentication

## Interface AuthenticationProvider

- All Superinterfaces:
    Provider
  All Known Implementing Classes:
    AbstractModelAuthenticationProvider, ExternalModelAuthenticationProvider, ModelAuthenticationProvider, PicketlinkAuthenticationProvider, PropertiesAuthenticationProvider

      public interface AuthenticationProvider
      extends Provider

  Author:
    Marek Posolda

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<String>` | `getAvailableOptions()` Get names of all available configuration options of current provider
    `String` | `getName()`
    `AuthUser` | `getUser(RealmModel realm, Map<String,String> configuration, String username)` Get user by given username or email.
    `String` | `registerUser(RealmModel realm, Map<String,String> configuration, String username)` Try to register user with this authentication provider
    `boolean` | `updateCredential(RealmModel realm, Map<String,String> configuration, String username, String password)` Update credential
    `AuthProviderStatus` | `validatePassword(RealmModel realm, Map<String,String> configuration, String username, String password)` Standard Authentication flow

    - ### Methods inherited from interface org.keycloak.provider.Provider

      `close`

- - ### Method Detail

    - #### getName

          String getName()

    - #### getAvailableOptions

          List<String> getAvailableOptions()

      Get names of all available configuration options of current provider
      Returns:
        options or empty list if no options available

    - #### getUser

          AuthUser getUser(RealmModel realm,
                         Map<String,String> configuration,
                         String username)
                           throws AuthenticationProviderException

      Get user by given username or email. Return user instance or null if user doesn't exists in this authentication provider
      Parameters:
        `realm` -
        `configuration` -
        `username` - or email
      Returns:
        found user or null if user with given username doesn't exists
      Throws:
        `AuthenticationProviderException`

    - #### registerUser

          String registerUser(RealmModel realm,
                            Map<String,String> configuration,
                            String username)
                              throws AuthenticationProviderException

      Try to register user with this authentication provider
      Parameters:
        `realm` -
        `configuration` -
        `username` -
      Returns:
        ID of newly created user (For example ID from LDAP)
      Throws:
        `AuthenticationProviderException` - if user creation couldn't happen

    - #### validatePassword

          AuthProviderStatus validatePassword(RealmModel realm,
                                            Map<String,String> configuration,
                                            String username,
                                            String password)
                                              throws AuthenticationProviderException

      Standard Authentication flow
      Parameters:
        `username` -
        `password` -
      Returns:
        result of authentication, which might eventually encapsulate info about authenticated user and provider which successfully authenticated
      Throws:
        `AuthenticationProviderException`

    - #### updateCredential

          boolean updateCredential(RealmModel realm,
                                 Map<String,String> configuration,
                                 String username,
                                 String password)
                                   throws AuthenticationProviderException

      Update credential
      Parameters:
        `realm` -
        `configuration` -
        `username` -
        `password` -
      Returns:
        true if credential has been successfully updated
      Throws:
        `AuthenticationProviderException`

Copyright © 2014. All Rights Reserved.