org.eclipse.jetty.security

## Class SpnegoUserIdentity

- java.lang.Object
- - org.eclipse.jetty.security.SpnegoUserIdentity

- All Implemented Interfaces:
    UserIdentity

      public class SpnegoUserIdentity
      extends Object
      implements UserIdentity

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.eclipse.jetty.server.UserIdentity

      `UserIdentity.Scope, UserIdentity.UnauthenticatedUserIdentity`

  - ### Field Summary

    - ### Fields inherited from interface org.eclipse.jetty.server.UserIdentity

      `UNAUTHENTICATED_IDENTITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SpnegoUserIdentity(Subject subject, Principal principal, List<String> roles)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Subject` | `getSubject()`
    `Principal` | `getUserPrincipal()`
    `boolean` | `isUserInRole(String role, UserIdentity.Scope scope)` Check if the user is in a role.

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

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

- - ### Constructor Detail

    - #### SpnegoUserIdentity

          public SpnegoUserIdentity(Subject subject,
                            Principal principal,
                            List<String> roles)

  - ### Method Detail

    - #### getSubject

          public Subject getSubject()

      Specified by:
        `getSubject` in interface `UserIdentity`
      Returns:
        The user subject

    - #### getUserPrincipal

          public Principal getUserPrincipal()

      Specified by:
        `getUserPrincipal` in interface `UserIdentity`
      Returns:
        The user principal

    - #### isUserInRole

          public boolean isUserInRole(String role,
                             UserIdentity.Scope scope)

      Description copied from interface: `UserIdentity`
      Check if the user is in a role. This call is used to satisfy authorization calls from container code which will be using translated role names.
      Specified by:
        `isUserInRole` in interface `UserIdentity`
      Parameters:
        `role` - A role name.
      Returns:
        True if the user can act in that role.

Copyright © 1995-2016 Mort Bay Consulting. All Rights Reserved.