org.wildfly.swarm.microprofile.jwtauth.deployment.auth.jaas

## Class JWTCredential

- java.lang.Object
- - org.wildfly.swarm.microprofile.jwtauth.deployment.auth.jaas.JWTCredential

-     public class JWTCredential
      extends Object

  This is an implementation of the undertow Credential that wraps the bearer token and configured JWTAuthContextInfo needed for validation of the token.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JWTCredential(String bearerToken, JWTAuthContextInfo authContextInfo)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `JWTAuthContextInfo` | `getAuthContextInfo()`
    `String` | `getBearerToken()`
    `Exception` | `getJwtException()`
    `String` | `getName()` This just parses the token without validation to extract one of the following in order to obtain the name to be used for the principal: upn preferred_username subject If there is an exception it sets the name to INVALID_TOKEN_NAME and saves the exception for access via `getJwtException()`

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

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

- - ### Constructor Detail

    - #### JWTCredential

          public JWTCredential(String bearerToken,
                               JWTAuthContextInfo authContextInfo)

      Parameters:
        `bearerToken` -
        `authContextInfo` -

  - ### Method Detail

    - #### getName

          public String getName()

      This just parses the token without validation to extract one of the following in order to obtain the name to be used for the principal: upn preferred_username subject If there is an exception it sets the name to INVALID_TOKEN_NAME and saves the exception for access via `getJwtException()`
      Returns:
        the name to use for the principal

    - #### getBearerToken

          public String getBearerToken()

    - #### getAuthContextInfo

          public JWTAuthContextInfo getAuthContextInfo()

    - #### getJwtException

          public Exception getJwtException()

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