public class TokenCredential extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TokenCredential.Builder
Fluent API builder for
TokenCredential. |
| Modifier and Type | Method and Description |
|---|---|
static TokenCredential.Builder |
builder()
Get a builder for this class.
|
static TokenCredential |
create(String token,
String issuer,
Instant issueTime,
Instant expTime)
Creates a new token credential for the specified token.
|
Optional<Instant> |
getExpTime()
Expiration time of the token.
|
Optional<String> |
getIssuer()
Issuer of the token.
|
Optional<Instant> |
getIssueTime()
Issue time of the token.
|
<U> Optional<U> |
getTokenInstance(Class<U> tokenClass)
Get a token of a specific class.
|
String |
token()
The full token string as it was received from token service.
|
String |
toString() |
public static TokenCredential create(String token, String issuer, Instant issueTime, Instant expTime)
token - Token value (as received from external client)issuer - Issuer of the token (such as accounts.google.com) - optionalissueTime - Time instant the token was issued - optionalexpTime - Time instant the token will expire - optionalpublic static TokenCredential.Builder builder()
public String token()
public Optional<Instant> getIssueTime()
public Optional<Instant> getExpTime()
public Optional<String> getIssuer()
public <U> Optional<U> getTokenInstance(Class<U> tokenClass)
U - type of the classtokenClass - class we want to getCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.