public class TokenInfo
extends java.lang.Object
It can also be used for storing extra application information associated with the access token by directly accessing the payload JSON object.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AUD
"aud"
|
static java.lang.String |
EXP
"exp"
|
static java.lang.String |
IAT
"iat"
|
static java.lang.String |
ISS
"iss"
|
static java.lang.String |
SCOPE
"scope"
|
static java.lang.String |
TOKEN_TYPE
"token_type"
|
static java.lang.String |
TYP
"typ"
|
| Constructor and Description |
|---|
TokenInfo(com.fasterxml.jackson.databind.JsonNode payload,
java.lang.String token,
java.lang.String principal)
Create a new instance
|
TokenInfo(com.fasterxml.jackson.databind.JsonNode payload,
java.lang.String token,
java.lang.String principal,
java.util.Set<java.lang.String> groups)
Create a new instance
|
TokenInfo(java.lang.String token,
java.util.Set<java.lang.String> scopes,
java.lang.String principal,
java.util.Set<java.lang.String> groups,
long issuedAtMs,
long expiresAtMs,
com.fasterxml.jackson.databind.JsonNode payload) |
TokenInfo(java.lang.String token,
java.lang.String scope,
java.lang.String principal,
java.util.Set<java.lang.String> groups,
long issuedAtMs,
long expiresAtMs) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
long |
expiresAtMs()
Get token expiry time in ISO millis time
|
java.util.Set<java.lang.String> |
groups()
Get groups for this token
|
int |
hashCode() |
long |
issuedAtMs()
Get token creation time ISO millis
|
com.fasterxml.jackson.databind.node.ObjectNode |
payload()
Get the payload object passed during construction.
|
java.lang.String |
principal()
Get a principal (user id) for this token
|
java.util.Set<java.lang.String> |
scope()
Get scopes for this token
|
java.lang.String |
token()
Get raw access token
|
public static final java.lang.String SCOPE
public static final java.lang.String IAT
public static final java.lang.String EXP
public static final java.lang.String ISS
public static final java.lang.String TYP
public static final java.lang.String TOKEN_TYPE
public static final java.lang.String AUD
public TokenInfo(com.fasterxml.jackson.databind.JsonNode payload,
java.lang.String token,
java.lang.String principal)
payload - The body of the JWT token or composed of authorization server's introspection endpoint responsetoken - The raw access tokenprincipal - The extracted user IDpublic TokenInfo(com.fasterxml.jackson.databind.JsonNode payload,
java.lang.String token,
java.lang.String principal,
java.util.Set<java.lang.String> groups)
payload - The body of the JWT token or composed of authorization server's introspection endpoint responsetoken - The raw access tokenprincipal - The extracted user IDgroups - A set of groups extracted from JWT token or authorization server's inspect endpoint responsepublic TokenInfo(java.lang.String token,
java.lang.String scope,
java.lang.String principal,
java.util.Set<java.lang.String> groups,
long issuedAtMs,
long expiresAtMs)
token - The raw access tokenscope - The scope returned by authorization server's inspect endpoint responseprincipal - The extracted user IDgroups - A set of groups extracted from JWT token or authorization server's inspect endpoint responseissuedAtMs - The token's `issued at` time in millisexpiresAtMs - The token's `expires at` time in millispublic TokenInfo(java.lang.String token,
java.util.Set<java.lang.String> scopes,
java.lang.String principal,
java.util.Set<java.lang.String> groups,
long issuedAtMs,
long expiresAtMs,
com.fasterxml.jackson.databind.JsonNode payload)
token - The raw access tokenscopes - The list of scopesprincipal - The extracted user IDgroups - A set of groups extracted from JWT token or authorization server's inspect endpoint responseissuedAtMs - The token's `issued at` time in millisexpiresAtMs - The token's `expires at` time in millispayload - The body of the JWT token or composed of authorization server's introspection endpoint responsepublic java.lang.String token()
public java.util.Set<java.lang.String> scope()
public long expiresAtMs()
public java.lang.String principal()
public java.util.Set<java.lang.String> groups()
public long issuedAtMs()
public com.fasterxml.jackson.databind.node.ObjectNode payload()
The same instance, passed to the TokenInfo constructor is returned which makes it possible to add custom attributes or make modifications during request processing.
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2024. All rights reserved.