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

## Class JWTAuthMechanism

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

-     public class JWTAuthMechanism
      extends Object

  An AuthenticationMechanism that validates a caller based on a MicroProfile JWT bearer token

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JWTAuthMechanism(JWTAuthContextInfo authContextInfo)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AuthenticationMechanismOutcome` | `authenticate(HttpServerExchange exchange, SecurityContext securityContext)` Extract the Authorization header and validate the bearer token if it exists.
    `ChallengeResult` | `sendChallenge(HttpServerExchange exchange, SecurityContext securityContext)`

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

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

- - ### Constructor Detail

    - #### JWTAuthMechanism

          public JWTAuthMechanism(JWTAuthContextInfo authContextInfo)

  - ### Method Detail

    - #### authenticate

          public AuthenticationMechanismOutcome authenticate(HttpServerExchange exchange,
                                                             SecurityContext securityContext)

      Extract the Authorization header and validate the bearer token if it exists. If it does, and is validated, this builds the org.jboss.security.SecurityContext authenticated Subject that drives the container APIs as well as the authorization layers.
      Parameters:
        `exchange` - - the http request exchange object
        `securityContext` - - the current security context that
      Returns:
        one of AUTHENTICATED, NOT_AUTHENTICATED or NOT_ATTEMPTED depending on the header and authentication outcome.

    - #### sendChallenge

          public ChallengeResult sendChallenge(HttpServerExchange exchange,
                                               SecurityContext securityContext)

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