org.keycloak.protocol.saml.mappers

## Class RoleNameMapper

- java.lang.Object
- - org.keycloak.protocol.saml.mappers.RoleNameMapper

- All Implemented Interfaces:
    ProtocolMapper, SAMLRoleNameMapper, ConfiguredProvider, Provider, ProviderFactory<ProtocolMapper>

      public class RoleNameMapper
      extends Object
      implements SAMLRoleNameMapper, ProtocolMapper

  Map an assigned role to a different position and name in the token
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RoleNameMapper()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` This is called when the server shuts down.
    `ProtocolMapper` | `create(KeycloakSession session)`
    `static ProtocolMapperModel` | `create(String name, String role, String newName)`
    `List<ProviderConfigProperty>` | `getConfigProperties()`
    `String` | `getDisplayCategory()`
    `String` | `getDisplayType()`
    `String` | `getHelpText()`
    `String` | `getId()`
    `String` | `getProtocol()`
    `void` | `init(Config.Scope config)` Only called once when the factory is first created.
    `String` | `mapName(ProtocolMapperModel model, RoleModel roleModel)`
    `void` | `postInit(KeycloakSessionFactory factory)` Called after all provider factories have been initialized

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

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

- - ### Field Detail

    - #### ROLE_CONFIG

          public static final String ROLE_CONFIG

      See Also:
        Constant Field Values

    - #### NEW_ROLE_NAME

          public static String NEW_ROLE_NAME

    - #### PROVIDER_ID

          public static final String PROVIDER_ID

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RoleNameMapper

          public RoleNameMapper()

  - ### Method Detail

    - #### getConfigProperties

          public List<ProviderConfigProperty> getConfigProperties()

      Specified by:
        `getConfigProperties` in interface `ConfiguredProvider`

    - #### getId

          public String getId()

      Specified by:
        `getId` in interface `ProviderFactory<ProtocolMapper>`

    - #### getDisplayType

          public String getDisplayType()

      Specified by:
        `getDisplayType` in interface `ProtocolMapper`

    - #### getDisplayCategory

          public String getDisplayCategory()

      Specified by:
        `getDisplayCategory` in interface `ProtocolMapper`

    - #### getHelpText

          public String getHelpText()

      Specified by:
        `getHelpText` in interface `ConfiguredProvider`

    - #### mapName

          public String mapName(ProtocolMapperModel model,
                                RoleModel roleModel)

      Specified by:
        `mapName` in interface `SAMLRoleNameMapper`

    - #### create

          public static ProtocolMapperModel create(String name,
                                                   String role,
                                                   String newName)

    - #### getProtocol

          public String getProtocol()

      Specified by:
        `getProtocol` in interface `ProtocolMapper`

    - #### close

          public void close()

      Description copied from interface: `ProviderFactory`
      This is called when the server shuts down.
      Specified by:
        `close` in interface `Provider`
      Specified by:
        `close` in interface `ProviderFactory<ProtocolMapper>`

    - #### init

          public void init(Config.Scope config)

      Description copied from interface: `ProviderFactory`
      Only called once when the factory is first created. This config is pulled from keycloak_server.json
      Specified by:
        `init` in interface `ProviderFactory<ProtocolMapper>`

    - #### create

          public final ProtocolMapper create(KeycloakSession session)

      Specified by:
        `create` in interface `ProviderFactory<ProtocolMapper>`

    - #### postInit

          public void postInit(KeycloakSessionFactory factory)

      Description copied from interface: `ProviderFactory`
      Called after all provider factories have been initialized
      Specified by:
        `postInit` in interface `ProviderFactory<ProtocolMapper>`

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