org.keycloak.social.twitter

## Class TwitterIdentityProvider

- java.lang.Object
- - org.keycloak.broker.provider.AbstractIdentityProvider<OAuth2IdentityProviderConfig>
  - - org.keycloak.social.twitter.TwitterIdentityProvider

- All Implemented Interfaces:
    IdentityProvider<OAuth2IdentityProviderConfig>, Provider, SocialIdentityProvider<OAuth2IdentityProviderConfig>

      public class TwitterIdentityProvider
      extends AbstractIdentityProvider<OAuth2IdentityProviderConfig>
      implements SocialIdentityProvider<OAuth2IdentityProviderConfig>

  Author:
    Stian Thorgersen

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `TwitterIdentityProvider.Endpoint`

    - ### Nested classes/interfaces inherited from interface org.keycloak.broker.provider.IdentityProvider

      `IdentityProvider.AuthenticationCallback`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.jboss.logging.Logger` | `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TwitterIdentityProvider(OAuth2IdentityProviderConfig config)`

  - ### 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` | `handleRequest(AuthenticationRequest request)` Initiates the authentication process by sending an authentication request to an identity provider.
    `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 class org.keycloak.broker.provider.AbstractIdentityProvider

      `close, export, getConfig, keycloakInitiatedBrowserLogout`

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

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

    - ### Methods inherited from interface org.keycloak.broker.provider.IdentityProvider

      `export, keycloakInitiatedBrowserLogout`

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

      `close`

- - ### Field Detail

    - #### logger

          protected static final org.jboss.logging.Logger logger

  - ### Constructor Detail

    - #### TwitterIdentityProvider

          public TwitterIdentityProvider(OAuth2IdentityProviderConfig config)

  - ### Method Detail

    - #### callback

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

      Description copied from interface: `IdentityProvider`
      JAXRS callback endpoint for when the remote IDP wants to callback to keycloak.
      Specified by:
        `callback` in interface `IdentityProvider<OAuth2IdentityProviderConfig>`
      Overrides:
        `callback` in class `AbstractIdentityProvider<OAuth2IdentityProviderConfig>`
      Returns:

    - #### handleRequest

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

      Description copied from interface: `IdentityProvider`

      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.

      Specified by:
        `handleRequest` in interface `IdentityProvider<OAuth2IdentityProviderConfig>`
      Parameters:
        `request` - The initial authentication request. Contains all the contextual information in order to build an authentication request to the identity provider.
      Returns:

    - #### retrieveToken

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

      Description copied from interface: `IdentityProvider`

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

      Specified by:
        `retrieveToken` in interface `IdentityProvider<OAuth2IdentityProviderConfig>`
      Returns:

Copyright © 2015. All rights reserved.