public class TokenCredential extends Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
TokenCredential.Builder |
Fluent API builder for
TokenCredential. |
| Modifier and Type | Method | 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() |
|
Optional<String> |
getIssuer() |
|
Optional<Instant> |
getIssueTime() |
|
String |
getToken() |
|
<U> Optional<U> |
getTokenInstance(Class<U> tokenClass) |
Get a token of a specific class.
|
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 getToken()
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.