org.keycloak.protocol.oidc

## Class DefaultTokenExchangeProvider

- java.lang.Object
- - org.keycloak.protocol.oidc.DefaultTokenExchangeProvider

- All Implemented Interfaces:
    TokenExchangeProvider, Provider

      public class DefaultTokenExchangeProvider
      extends Object
      implements TokenExchangeProvider

  Default token exchange implementation
  Author:
    Dmitry Telegin

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultTokenExchangeProvider()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `javax.ws.rs.core.Response` | `exchange(TokenExchangeContext context)` Exchange the `token`.
    `protected javax.ws.rs.core.Response` | `exchangeClientToClient(UserModel targetUser, UserSessionModel targetUserSession)`
    `protected javax.ws.rs.core.Response` | `exchangeClientToOIDCClient(UserModel targetUser, UserSessionModel targetUserSession, String requestedTokenType, ClientModel targetClient, String audience, String scope)`
    `protected javax.ws.rs.core.Response` | `exchangeClientToSAML2Client(UserModel targetUser, UserSessionModel targetUserSession, String requestedTokenType, ClientModel targetClient, String audience, String scope)`
    `protected javax.ws.rs.core.Response` | `exchangeExternalToken(String issuer, String subjectToken)`
    `protected javax.ws.rs.core.Response` | `exchangeToIdentityProvider(UserModel targetUser, UserSessionModel targetUserSession, String requestedIssuer)`
    `protected UserModel` | `importUserFromExternalIdentity(BrokeredIdentityContext context)`
    `boolean` | `supports(TokenExchangeContext context)` Check if exchange request is supported by this provider
    `protected javax.ws.rs.core.Response` | `tokenExchange()`

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

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

- - ### Constructor Detail

    - #### DefaultTokenExchangeProvider

          public DefaultTokenExchangeProvider()

  - ### Method Detail

    - #### supports

          public boolean supports(TokenExchangeContext context)

      Description copied from interface: `TokenExchangeProvider`
      Check if exchange request is supported by this provider
      Specified by:
        `supports` in interface `TokenExchangeProvider`
      Parameters:
        `context` - token exchange context
      Returns:
        true if the request is supported

    - #### exchange

          public javax.ws.rs.core.Response exchange(TokenExchangeContext context)

      Description copied from interface: `TokenExchangeProvider`
      Exchange the `token`.
      Specified by:
        `exchange` in interface `TokenExchangeProvider`
      Returns:
        response with a new token

    - #### close

          public void close()

      Specified by:
        `close` in interface `Provider`

    - #### tokenExchange

          protected javax.ws.rs.core.Response tokenExchange()

    - #### exchangeToIdentityProvider

          protected javax.ws.rs.core.Response exchangeToIdentityProvider(UserModel targetUser,
                                                                         UserSessionModel targetUserSession,
                                                                         String requestedIssuer)

    - #### exchangeClientToClient

          protected javax.ws.rs.core.Response exchangeClientToClient(UserModel targetUser,
                                                                     UserSessionModel targetUserSession)

    - #### exchangeClientToOIDCClient

          protected javax.ws.rs.core.Response exchangeClientToOIDCClient(UserModel targetUser,
                                                                         UserSessionModel targetUserSession,
                                                                         String requestedTokenType,
                                                                         ClientModel targetClient,
                                                                         String audience,
                                                                         String scope)

    - #### exchangeClientToSAML2Client

          protected javax.ws.rs.core.Response exchangeClientToSAML2Client(UserModel targetUser,
                                                                          UserSessionModel targetUserSession,
                                                                          String requestedTokenType,
                                                                          ClientModel targetClient,
                                                                          String audience,
                                                                          String scope)

    - #### exchangeExternalToken

          protected javax.ws.rs.core.Response exchangeExternalToken(String issuer,
                                                                    String subjectToken)

    - #### importUserFromExternalIdentity

          protected UserModel importUserFromExternalIdentity(BrokeredIdentityContext context)

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