org.keycloak.adapters.tomcat

## Class GenericPrincipalFactory

- java.lang.Object
- - org.keycloak.adapters.tomcat.GenericPrincipalFactory

- Direct Known Subclasses:
    JBossWebPrincipalFactory

      public abstract class GenericPrincipalFactory
      extends Object

  Version:
    $Revision: 1 $
  Author:
    Davide Ungari

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GenericPrincipalFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Group` | `createGroup(String name, Set<Principal> principals)`
    `protected abstract org.apache.catalina.realm.GenericPrincipal` | `createPrincipal(Principal userPrincipal, List<String> roles)`
    `org.apache.catalina.realm.GenericPrincipal` | `createPrincipal(org.apache.catalina.Realm realm, Principal identity, Set<String> roleSet, KeycloakSecurityContext securityContext)`
    `protected Principal` | `getPrincipal(Subject subject)` Get the Principal given the authenticated Subject.
    `protected Group[]` | `getRoleSets(Collection<String> roleSet)`

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

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

- - ### Constructor Detail

    - #### GenericPrincipalFactory

          public GenericPrincipalFactory()

  - ### Method Detail

    - #### createPrincipal

          public org.apache.catalina.realm.GenericPrincipal createPrincipal(org.apache.catalina.Realm realm,
                                                                   Principal identity,
                                                                   Set<String> roleSet,
                                                                   KeycloakSecurityContext securityContext)

    - #### createPrincipal

          protected abstract org.apache.catalina.realm.GenericPrincipal createPrincipal(Principal userPrincipal,
                                                                   List<String> roles)

    - #### getPrincipal

          protected Principal getPrincipal(Subject subject)

      Get the Principal given the authenticated Subject. Currently the first subject that is not of type `Group` is considered or the single subject inside the CallerPrincipal group.
      Parameters:
        `subject` -
      Returns:
        the authenticated subject

    - #### createGroup

          protected Group createGroup(String name,
                          Set<Principal> principals)

    - #### getRoleSets

          protected Group[] getRoleSets(Collection<String> roleSet)

Copyright © 2015. All Rights Reserved.