org.keycloak.authentication.model

## Class AbstractModelAuthenticationProvider

- java.lang.Object
- - org.keycloak.authentication.model.AbstractModelAuthenticationProvider

- All Implemented Interfaces:
    AuthenticationProvider, Provider
  Direct Known Subclasses:
    ExternalModelAuthenticationProvider, ModelAuthenticationProvider

      public abstract class AbstractModelAuthenticationProvider
      extends Object
      implements AuthenticationProvider

  Authentication provider, which delegates calling of all methods to specified realm
  Author:
    Marek Posolda

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractModelAuthenticationProvider()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `protected AuthUser` | `createAuthenticatedUserInstance(UserModel user)`
    `protected abstract RealmModel` | `getRealm(RealmModel currentRealm, Map<String,String> config)`
    `AuthUser` | `getUser(RealmModel currentRealm, Map<String,String> config, String username)` Get user by given username or email.
    `String` | `registerUser(RealmModel currentRealm, Map<String,String> config, String username)` Try to register user with this authentication provider
    `boolean` | `updateCredential(RealmModel currentRealm, Map<String,String> config, String username, String password)` Update credential
    `AuthProviderStatus` | `validatePassword(RealmModel currentRealm, Map<String,String> config, String username, String password)` Standard Authentication flow

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

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

    - ### Methods inherited from interface org.keycloak.authentication.AuthenticationProvider

      `getAvailableOptions, getName`

- - ### Constructor Detail

    - #### AbstractModelAuthenticationProvider

          public AbstractModelAuthenticationProvider()

  - ### Method Detail

    - #### getUser

          public AuthUser getUser(RealmModel currentRealm,
                         Map<String,String> config,
                         String username)
                           throws AuthenticationProviderException

      Description copied from interface: `AuthenticationProvider`
      Get user by given username or email. Return user instance or null if user doesn't exists in this authentication provider
      Specified by:
        `getUser` in interface `AuthenticationProvider`
        `username` - or email
      Returns:
        found user or null if user with given username doesn't exists
      Throws:
        `AuthenticationProviderException`

    - #### registerUser

          public String registerUser(RealmModel currentRealm,
                            Map<String,String> config,
                            String username)
                              throws AuthenticationProviderException

      Description copied from interface: `AuthenticationProvider`
      Try to register user with this authentication provider
      Specified by:
        `registerUser` in interface `AuthenticationProvider`
      Returns:
        ID of newly created user (For example ID from LDAP)
      Throws:
        `AuthenticationProviderException` - if user creation couldn't happen

    - #### validatePassword

          public AuthProviderStatus validatePassword(RealmModel currentRealm,
                                            Map<String,String> config,
                                            String username,
                                            String password)
                                              throws AuthenticationProviderException

      Description copied from interface: `AuthenticationProvider`
      Standard Authentication flow
      Specified by:
        `validatePassword` in interface `AuthenticationProvider`
      Returns:
        result of authentication, which might eventually encapsulate info about authenticated user and provider which successfully authenticated
      Throws:
        `AuthenticationProviderException`

    - #### updateCredential

          public boolean updateCredential(RealmModel currentRealm,
                                 Map<String,String> config,
                                 String username,
                                 String password)
                                   throws AuthenticationProviderException

      Description copied from interface: `AuthenticationProvider`
      Update credential
      Specified by:
        `updateCredential` in interface `AuthenticationProvider`
      Returns:
        true if credential has been successfully updated
      Throws:
        `AuthenticationProviderException`

    - #### close

          public void close()

      Specified by:
        `close` in interface `Provider`

    - #### getRealm

          protected abstract RealmModel getRealm(RealmModel currentRealm,
                            Map<String,String> config)
                                          throws AuthenticationProviderException

      Throws:
        `AuthenticationProviderException`

    - #### createAuthenticatedUserInstance

          protected AuthUser createAuthenticatedUserInstance(UserModel user)

Copyright © 2014. All Rights Reserved.