org.wildfly.swarm.microprofile.jwtauth.deployment.principal

## Class DefaultJWTCallerPrincipal

- java.lang.Object
- - org.wildfly.swarm.microprofile.jwtauth.deployment.principal.JWTCallerPrincipal
  - - org.wildfly.swarm.microprofile.jwtauth.deployment.principal.DefaultJWTCallerPrincipal

-     public class DefaultJWTCallerPrincipal
      extends JWTCallerPrincipal

  A default implementation of JWTCallerPrincipal that wraps the jose4j JwtClaims.
  See Also:
    `JwtClaims`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultJWTCallerPrincipal(String jwt, String type, JwtClaims claimsSet, String name)` Create the DefaultJWTCallerPrincipal from the parsed JWT token and the extracted principal name

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<String>` | `getAudience()`
    `Object` | `getClaim(String claimName)`
    `Set<String>` | `getClaimNames()`
    `Set<String>` | `getGroups()`
    `boolean` | `implies(Subject subject)`
    `String` | `toString()`
    `String` | `toString(boolean showAll)` TODO: showAll is ignored and currently assumed true

    - ### Methods inherited from class org.wildfly.swarm.microprofile.jwtauth.deployment.principal.JWTCallerPrincipal

      `claim, getName`

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

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultJWTCallerPrincipal

          public DefaultJWTCallerPrincipal(String jwt,
                                           String type,
                                           JwtClaims claimsSet,
                                           String name)

      Create the DefaultJWTCallerPrincipal from the parsed JWT token and the extracted principal name
      Parameters:
        `jwt` - - the parsed JWT token representation
        `name` - - the extracted unqiue name to use as the principal name; from "upn", "preferred_username" or "sub" claim

  - ### Method Detail

    - #### getAudience

          public Set<String> getAudience()

    - #### getGroups

          public Set<String> getGroups()

    - #### getClaimNames

          public Set<String> getClaimNames()

    - #### getClaim

          public Object getClaim(String claimName)

    - #### implies

          public boolean implies(Subject subject)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toString

          public String toString(boolean showAll)

      TODO: showAll is ignored and currently assumed true
      Specified by:
        `toString` in class `JWTCallerPrincipal`
      Parameters:
        `showAll` - - should all claims associated with the JWT be displayed or should only those defined in the JsonWebToken interface be displayed.
      Returns:
        JWTCallerPrincipal string view

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