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

## Class JWTCallerPrincipalFactory

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

- Direct Known Subclasses:
    DefaultJWTCallerPrincipalFactory

      public abstract class JWTCallerPrincipalFactory
      extends Object

  The factory class that provides the token string to JWTCallerPrincipal parsing for a given implementation.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JWTCallerPrincipalFactory()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JWTCallerPrincipalFactory` | `instance()` Obtain the JWTCallerPrincipalFactory that has been set or by using the ServiceLoader pattern.
    `abstract JWTCallerPrincipal` | `parse(String token, JWTAuthContextInfo authContextInfo)` Parse the given bearer token string into a JWTCallerPrincipal instance.
    `static void` | `setInstance(JWTCallerPrincipalFactory resolver)` Set the instance.

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

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

- - ### Constructor Detail

    - #### JWTCallerPrincipalFactory

          public JWTCallerPrincipalFactory()

  - ### Method Detail

    - #### instance

          public static JWTCallerPrincipalFactory instance()

      Obtain the JWTCallerPrincipalFactory that has been set or by using the ServiceLoader pattern.
      Returns:
        the factory instance
      See Also:
        `setInstance(JWTCallerPrincipalFactory)`

    - #### setInstance

          public static void setInstance(JWTCallerPrincipalFactory resolver)

      Set the instance. It is used by OSGi environment where service loader pattern is not supported.
      Parameters:
        `resolver` - the instance to use.

    - #### parse

          public abstract JWTCallerPrincipal parse(String token,
                                                   JWTAuthContextInfo authContextInfo)
                                            throws ParseException

      Parse the given bearer token string into a JWTCallerPrincipal instance.
      Parameters:
        `token` - - the bearer token provided for authorization
      Returns:
        A JWTCallerPrincipal representation for the token.
      Throws:
        `ParseException` - on parse or verification failure.

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