io.vertx.ext.auth.authentication

## Class TokenCredentials

- java.lang.Object
- - io.vertx.ext.auth.authentication.TokenCredentials

- All Implemented Interfaces:
    Credentials

      public class TokenCredentials
      extends Object
      implements Credentials

  Credentials used by any `AuthenticationProvider` that requires Tokens, such as OAuth2 or JWT to perform its authentication
  Author:
    Paulo Lopes

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `TokenCredentials()`
    `` | `TokenCredentials(JsonObject jsonObject)`
    `` | `TokenCredentials(String token)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<V> void` | `checkValid(V arg)` Implementors should override this method to perform validation.
    `String` | `getToken()`
    `TokenCredentials` | `setToken(String token)`
    `JsonObject` | `toJson()` Simple interop to downcast back to JSON for backwards compatibility.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### TokenCredentials

          protected TokenCredentials()

    - #### TokenCredentials

          public TokenCredentials(String token)

    - #### TokenCredentials

          public TokenCredentials(JsonObject jsonObject)

  - ### Method Detail

    - #### getToken

          public String getToken()

    - #### setToken

          public TokenCredentials setToken(String token)

    - #### checkValid

          public <V> void checkValid(V arg)
                              throws CredentialValidationException

      Description copied from interface: `Credentials`
      Implementors should override this method to perform validation. An argument is allowed to allow custom validation, for example, when given a configuration property, a specific property may be allowed to be null.
      Specified by:
        `checkValid` in interface `Credentials`
      Type Parameters:
        `V` - the generic type of the argument
      Parameters:
        `arg` - optional argument or null.
      Throws:
        `CredentialValidationException` - when the validation fails

    - #### toJson

          public JsonObject toJson()

      Description copied from interface: `Credentials`
      Simple interop to downcast back to JSON for backwards compatibility.
      Specified by:
        `toJson` in interface `Credentials`
      Returns:
        JSON representation of this credential.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2020 Eclipse. All rights reserved.