Package io.yellowbrick.jdbc.oauth2

## Class Token

- java.lang.Object
- - io.yellowbrick.jdbc.oauth2.Token

    public class Token
    extends Object

Represents an OAuth2 token used for authentication with the Yellowbrick database. This class encapsulates the access or id token, refresh token, expiration time, and additional properties used to obtain the connection.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static Properties` `copyOf​(Properties info)`
`static Token` `createToken​(String authToken, String refreshToken, Instant expiresAt, String url, Properties info)`
`static Token` `fromJSONObject​(org.json.JSONObject json)`
`String` `getAuthToken()`
`String` `getConnection()`
`Instant` `getExpiresAt()`
`Properties` `getInfo()`
`String` `getRefreshToken()`
`DriverConfiguration.TokenCacheOption` `getTokenCacheOption()`
`boolean` `matches​(String connection, Properties info)`
`org.json.JSONObject` `toJSONObject()`

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

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

### Method Detail

#### createToken

    public static Token createToken​(String authToken,
                                    String refreshToken,
                                    Instant expiresAt,
                                    String url,
                                    Properties info)
                             throws SQLException

Throws:
  `SQLException`

#### getAuthToken

    public String getAuthToken()

#### getRefreshToken

    public String getRefreshToken()

#### getExpiresAt

    public Instant getExpiresAt()

#### getConnection

    public String getConnection()

#### getInfo

    public Properties getInfo()

#### getTokenCacheOption

    public DriverConfiguration.TokenCacheOption getTokenCacheOption()

#### copyOf

    public static Properties copyOf​(Properties info)

#### matches

    public boolean matches​(String connection,
                           Properties info)

#### toJSONObject

    public org.json.JSONObject toJSONObject()

#### fromJSONObject

    public static Token fromJSONObject​(org.json.JSONObject json)
                                throws SQLException

Throws:
  `SQLException`