org.keycloak.broker.provider

## Interface IdentityProvider<C extends IdentityProviderModel>

- All Superinterfaces:
    Provider
  All Known Subinterfaces:
    SocialIdentityProvider<C>
  All Known Implementing Classes:
    AbstractIdentityProvider, AbstractOAuth2IdentityProvider, FacebookIdentityProvider, GitHubIdentityProvider, GoogleIdentityProvider, KeycloakOIDCIdentityProvider, LinkedInIdentityProvider, OIDCIdentityProvider, SAMLIdentityProvider, StackoverflowIdentityProvider, TwitterIdentityProvider

      public interface IdentityProvider<C extends IdentityProviderModel>
      extends Provider

  Author:
    Pedro Igor

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `IdentityProvider.AuthenticationCallback`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `callback(RealmModel realm, IdentityProvider.AuthenticationCallback callback, EventBuilder event)` JAXRS callback endpoint for when the remote IDP wants to callback to keycloak.
    `javax.ws.rs.core.Response` | `export(javax.ws.rs.core.UriInfo uriInfo, RealmModel realm, String format)` Export a representation of the IdentityProvider in a specific format.
    `javax.ws.rs.core.Response` | `handleRequest(AuthenticationRequest request)` Initiates the authentication process by sending an authentication request to an identity provider.
    `javax.ws.rs.core.Response` | `keycloakInitiatedBrowserLogout(UserSessionModel userSession, javax.ws.rs.core.UriInfo uriInfo, RealmModel realm)` Called when a Keycloak application initiates a logout through the browser.
    `javax.ws.rs.core.Response` | `retrieveToken(FederatedIdentityModel identity)` Returns a `Response` containing the token previously stored during the authentication process for a specific user.

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

      `close`

- - ### Method Detail

    - #### callback

          Object callback(RealmModel realm,
                        IdentityProvider.AuthenticationCallback callback,
                        EventBuilder event)

      JAXRS callback endpoint for when the remote IDP wants to callback to keycloak.
      Returns:

    - #### handleRequest

          javax.ws.rs.core.Response handleRequest(AuthenticationRequest request)

      Initiates the authentication process by sending an authentication request to an identity provider. This method is called only once during the authentication.

      Depending on how the authentication is performed, this method may redirect the user to the identity provider for authentication. In this case, the response would contain a `Response` that will be used to redirect the user.

      However, if the authentication flow does not require a redirect to the identity provider (eg.: simple challenge/response mechanism), this method may return a response containing a `FederatedIdentity` representing the identity information for an user. In this case, the authentication flow stops.

      Parameters:
        `request` - The initial authentication request. Contains all the contextual information in order to build an authentication request to the identity provider.
      Returns:

    - #### retrieveToken

          javax.ws.rs.core.Response retrieveToken(FederatedIdentityModel identity)

      Returns a `Response` containing the token previously stored during the authentication process for a specific user.

      Parameters:
        `identity` -
      Returns:

    - #### keycloakInitiatedBrowserLogout

          javax.ws.rs.core.Response keycloakInitiatedBrowserLogout(UserSessionModel userSession,
                                                                 javax.ws.rs.core.UriInfo uriInfo,
                                                                 RealmModel realm)

      Called when a Keycloak application initiates a logout through the browser. This is expected to do a logout with the IDP
      Parameters:
        `userSession` -
        `uriInfo` -
        `realm` -
      Returns:
        null if this is not supported by this provider

    - #### export

          javax.ws.rs.core.Response export(javax.ws.rs.core.UriInfo uriInfo,
                                         RealmModel realm,
                                         String format)

      Export a representation of the IdentityProvider in a specific format. For example, a SAML EntityDescriptor
      Returns:

Copyright © 2015. All rights reserved.