org.keycloak.protocol.oidc.mappers

## Class SHA256PairwiseSubMapper

- java.lang.Object
- - org.keycloak.protocol.oidc.mappers.AbstractOIDCProtocolMapper
  - - org.keycloak.protocol.oidc.mappers.AbstractPairwiseSubMapper
    - - org.keycloak.protocol.oidc.mappers.SHA256PairwiseSubMapper

- All Implemented Interfaces:
    OIDCAccessTokenMapper, OIDCIDTokenMapper, UserInfoTokenMapper, ProtocolMapper, ConfiguredProvider, Provider, ProviderFactory<ProtocolMapper>

      public class SHA256PairwiseSubMapper
      extends AbstractPairwiseSubMapper

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `PROVIDER_ID`

    - ### Fields inherited from class org.keycloak.protocol.oidc.mappers.AbstractPairwiseSubMapper

      `PROVIDER_ID_SUFFIX`

    - ### Fields inherited from class org.keycloak.protocol.oidc.mappers.AbstractOIDCProtocolMapper

      `TOKEN_MAPPER_CATEGORY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SHA256PairwiseSubMapper()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ProtocolMapperRepresentation` | `createPairwiseMapper(String sectorIdentifierUri, String salt)`
    `String` | `generateSub(ProtocolMapperModel mappingModel, String sectorIdentifier, String localSub)` Generates a pairwise subject identifier.
    `List<ProviderConfigProperty>` | `getAdditionalConfigProperties()` Override to add additional provider configuration properties.
    `String` | `getDisplayType()`
    `String` | `getHelpText()`
    `String` | `getIdPrefix()`
    `void` | `validateAdditionalConfig(KeycloakSession session, RealmModel realm, ProtocolMapperContainerModel mapperContainer, ProtocolMapperModel mapperModel)` Override to add additional configuration validation.

    - ### Methods inherited from class org.keycloak.protocol.oidc.mappers.AbstractPairwiseSubMapper

      `getConfigProperties, getDisplayCategory, getId, setAccessTokenSubject, setIDTokenSubject, setUserInfoTokenSubject, transformAccessToken, transformIDToken, transformUserInfoToken, validateConfig`

    - ### Methods inherited from class org.keycloak.protocol.oidc.mappers.AbstractOIDCProtocolMapper

      `close, create, getProtocol, init, postInit, setClaim, setClaim, setClaim, transformAccessTokenResponse`

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

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

    - ### Methods inherited from interface org.keycloak.protocol.ProtocolMapper

      `getPriority`

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

      `order`

- - ### Field Detail

    - #### PROVIDER_ID

          public static final String PROVIDER_ID

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SHA256PairwiseSubMapper

          public SHA256PairwiseSubMapper()

  - ### Method Detail

    - #### createPairwiseMapper

          public static ProtocolMapperRepresentation createPairwiseMapper(String sectorIdentifierUri,
                                                                          String salt)

    - #### validateAdditionalConfig

          public void validateAdditionalConfig(KeycloakSession session,
                                               RealmModel realm,
                                               ProtocolMapperContainerModel mapperContainer,
                                               ProtocolMapperModel mapperModel)
                                        throws ProtocolMapperConfigException

      Description copied from class: `AbstractPairwiseSubMapper`
      Override to add additional configuration validation. Called when instance of mapperModel is created/updated for this protocolMapper through admin endpoint.
      Overrides:
        `validateAdditionalConfig` in class `AbstractPairwiseSubMapper`
        `mapperContainer` - client or clientScope
      Throws:
        `ProtocolMapperConfigException` - if configuration provided in mapperModel is not valid

    - #### getHelpText

          public String getHelpText()

    - #### getAdditionalConfigProperties

          public List<ProviderConfigProperty> getAdditionalConfigProperties()

      Description copied from class: `AbstractPairwiseSubMapper`
      Override to add additional provider configuration properties. By default, a pairwise sub mapper will only contain configuration for a sector identifier URI.
      Overrides:
        `getAdditionalConfigProperties` in class `AbstractPairwiseSubMapper`
      Returns:
        A list of provider configuration properties.

    - #### generateSub

          public String generateSub(ProtocolMapperModel mappingModel,
                                    String sectorIdentifier,
                                    String localSub)

      Description copied from class: `AbstractPairwiseSubMapper`
      Generates a pairwise subject identifier.
      Specified by:
        `generateSub` in class `AbstractPairwiseSubMapper`
        `sectorIdentifier` - client sector identifier
        `localSub` - local subject identifier (user id)
      Returns:
        A pairwise subject identifier

    - #### getDisplayType

          public String getDisplayType()

    - #### getIdPrefix

          public String getIdPrefix()

      Specified by:
        `getIdPrefix` in class `AbstractPairwiseSubMapper`

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