org.keycloak.social.gitlab

## Class GitLabIdentityProvider

- java.lang.Object
- - org.keycloak.broker.provider.AbstractIdentityProvider<C>
  - - org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider<OIDCIdentityProviderConfig>
    - - org.keycloak.broker.oidc.OIDCIdentityProvider
      - - org.keycloak.social.gitlab.GitLabIdentityProvider

- All Implemented Interfaces:
    ExchangeExternalToken, ExchangeTokenToIdentityProviderToken, IdentityProvider<OIDCIdentityProviderConfig>, SocialIdentityProvider<OIDCIdentityProviderConfig>, Provider

      public class GitLabIdentityProvider
      extends OIDCIdentityProvider
      implements SocialIdentityProvider<OIDCIdentityProviderConfig>

  Author:
    Stian Thorgersen

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.keycloak.broker.oidc.OIDCIdentityProvider

      `OIDCIdentityProvider.OIDCEndpoint`

    - ### Nested classes/interfaces inherited from class org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider

      `AbstractOAuth2IdentityProvider.Endpoint`

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

      `IdentityProvider.AuthenticationCallback`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `API_SCOPE`
    `static String` | `AUTH_URL`
    `static String` | `TOKEN_URL`
    `static String` | `USER_INFO`

    - ### Fields inherited from class org.keycloak.broker.oidc.OIDCIdentityProvider

      `ACCESS_TOKEN_EXPIRATION, EXCHANGE_PROVIDER, FEDERATED_ACCESS_TOKEN_RESPONSE, FEDERATED_ID_TOKEN, logger, SCOPE_OPENID, VALIDATED_ID_TOKEN`

    - ### Fields inherited from class org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider

      `ACCESS_DENIED, FEDERATED_REFRESH_TOKEN, FEDERATED_TOKEN_EXPIRATION, mapper, OAUTH2_GRANT_TYPE_AUTHORIZATION_CODE, OAUTH2_GRANT_TYPE_REFRESH_TOKEN, OAUTH2_PARAMETER_ACCESS_TOKEN, OAUTH2_PARAMETER_CLIENT_ID, OAUTH2_PARAMETER_CLIENT_SECRET, OAUTH2_PARAMETER_CODE, OAUTH2_PARAMETER_GRANT_TYPE, OAUTH2_PARAMETER_REDIRECT_URI, OAUTH2_PARAMETER_RESPONSE_TYPE, OAUTH2_PARAMETER_SCOPE, OAUTH2_PARAMETER_STATE`

    - ### Fields inherited from class org.keycloak.broker.provider.AbstractIdentityProvider

      `ACCOUNT_LINK_URL, session`

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

      `EXTERNAL_IDENTITY_PROVIDER, FEDERATED_ACCESS_TOKEN`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GitLabIdentityProvider(KeycloakSession session, OIDCIdentityProviderConfig config)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected BrokeredIdentityContext` | `exchangeExternalImpl(EventBuilder event, javax.ws.rs.core.MultivaluedMap<String,String> params)`
    `protected BrokeredIdentityContext` | `extractIdentity(AccessTokenResponse tokenResponse, String accessToken, JsonWebToken idToken)`
    `protected BrokeredIdentityContext` | `extractIdentityFromProfile(EventBuilder event, com.fasterxml.jackson.databind.JsonNode profile)`
    `protected String` | `getProfileEndpointForValidation(EventBuilder event)`
    `protected String` | `getusernameClaimNameForIdToken()`
    `protected String` | `getUsernameFromUserInfo(com.fasterxml.jackson.databind.JsonNode userInfo)`
    `boolean` | `isIssuer(String issuer, javax.ws.rs.core.MultivaluedMap<String,String> params)`
    `protected boolean` | `supportsExternalExchange()`

    - ### Methods inherited from class org.keycloak.broker.oidc.OIDCIdentityProvider

      `authenticationFinished, backchannelLogout, backchannelLogout, callback, createAuthorizationUrl, exchangeSessionToken, exchangeStoredToken, getDefaultScopes, getFederatedIdentity, getRefreshTokenRequest, getUserInfoUrl, keycloakInitiatedBrowserLogout, preprocessFederatedIdentity, processAccessTokenResponse, refreshTokenForLogout, validateJwt, validateToken, validateToken, verify`

    - ### Methods inherited from class org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider

      `asJsonNode, authenticateTokenRequest, buildUserInfoRequest, doGetFederatedIdentity, exchangeExternal, exchangeExternalComplete, exchangeExternalUserInfoValidationOnly, exchangeFromToken, extractTokenFromResponse, generateToken, getAccessTokenResponseParameter, getConfig, getJsonProperty, getSignatureContext, hasExternalExchangeToken, performLogin, retrieveToken, validateExternalTokenThroughUserInfo`

    - ### Methods inherited from class org.keycloak.broker.provider.AbstractIdentityProvider

      `close, exchangeErrorResponse, exchangeNotLinked, exchangeNotLinkedNoStore, exchangeNotSupported, exchangeTokenExpired, exchangeUnsupportedRequiredType, export, getLinkingUrl, getMarshaller, importNewUser, updateBrokeredUser`

    - ### 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

      `authenticationFinished, backchannelLogout, callback, export, getMarshaller, importNewUser, keycloakInitiatedBrowserLogout, performLogin, preprocessFederatedIdentity, retrieveToken, updateBrokeredUser`

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

      `close`

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

      `exchangeExternal, exchangeExternalComplete`

- - ### Field Detail

    - #### AUTH_URL

          public static final String AUTH_URL

      See Also:
        Constant Field Values

    - #### TOKEN_URL

          public static final String TOKEN_URL

      See Also:
        Constant Field Values

    - #### USER_INFO

          public static final String USER_INFO

      See Also:
        Constant Field Values

    - #### API_SCOPE

          public static final String API_SCOPE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### GitLabIdentityProvider

          public GitLabIdentityProvider(KeycloakSession session,
                                        OIDCIdentityProviderConfig config)

  - ### Method Detail

    - #### getUsernameFromUserInfo

          protected String getUsernameFromUserInfo(com.fasterxml.jackson.databind.JsonNode userInfo)

      Overrides:
        `getUsernameFromUserInfo` in class `OIDCIdentityProvider`

    - #### getusernameClaimNameForIdToken

          protected String getusernameClaimNameForIdToken()

      Overrides:
        `getusernameClaimNameForIdToken` in class `OIDCIdentityProvider`

    - #### supportsExternalExchange

          protected boolean supportsExternalExchange()

      Overrides:
        `supportsExternalExchange` in class `OIDCIdentityProvider`

    - #### getProfileEndpointForValidation

          protected String getProfileEndpointForValidation(EventBuilder event)

      Overrides:
        `getProfileEndpointForValidation` in class `OIDCIdentityProvider`

    - #### isIssuer

          public boolean isIssuer(String issuer,
                                  javax.ws.rs.core.MultivaluedMap<String,String> params)

      Specified by:
        `isIssuer` in interface `ExchangeExternalToken`
      Overrides:
        `isIssuer` in class `OIDCIdentityProvider`

    - #### exchangeExternalImpl

          protected BrokeredIdentityContext exchangeExternalImpl(EventBuilder event,
                                                                 javax.ws.rs.core.MultivaluedMap<String,String> params)

      Overrides:
        `exchangeExternalImpl` in class `OIDCIdentityProvider`

    - #### extractIdentityFromProfile

          protected BrokeredIdentityContext extractIdentityFromProfile(EventBuilder event,
                                                                       com.fasterxml.jackson.databind.JsonNode profile)

      Overrides:
        `extractIdentityFromProfile` in class `OIDCIdentityProvider`

    - #### extractIdentity

          protected BrokeredIdentityContext extractIdentity(AccessTokenResponse tokenResponse,
                                                            String accessToken,
                                                            JsonWebToken idToken)
                                                     throws IOException

      Overrides:
        `extractIdentity` in class `OIDCIdentityProvider`
      Throws:
        `IOException`

Copyright © 2021 JBoss by Red Hat. All rights reserved.