-
public class TokenSource.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static TokenSource.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final FixedTokenSourcefromLiteral(String serverUrl, String participantToken)Creates a FixedTokenSource that immediately returns with the supplied serverUrl and participantToken. final ConfigurableTokenSourcefromCustom(SuspendFunction1<TokenRequestOptions, Result<TokenSourceResponse>> block)Creates a custom ConfigurableTokenSource that executes block to fetch the credentials. final ConfigurableTokenSourcefromEndpoint(String url, String method, Map<String, String> headers)Creates a ConfigurableTokenSource that fetches from a given url using the standard token server format. final ConfigurableTokenSourcefromEndpoint(URL url, String method, Map<String, String> headers)Creates a ConfigurableTokenSource that fetches from a given url using the standard token server format. final ConfigurableTokenSourcefromSandboxTokenServer(String sandboxId, SandboxTokenServerOptions options)Creates a ConfigurableTokenSource that fetches from a sandbox token server for credentials, which supports quick prototyping/getting started types of use cases. -
-
Method Detail
-
fromLiteral
final FixedTokenSource fromLiteral(String serverUrl, String participantToken)
Creates a FixedTokenSource that immediately returns with the supplied serverUrl and participantToken.
-
fromCustom
final ConfigurableTokenSource fromCustom(SuspendFunction1<TokenRequestOptions, Result<TokenSourceResponse>> block)
Creates a custom ConfigurableTokenSource that executes block to fetch the credentials.
-
fromEndpoint
final ConfigurableTokenSource fromEndpoint(String url, String method, Map<String, String> headers)
Creates a ConfigurableTokenSource that fetches from a given url using the standard token server format.
- Parameters:
method- the HTTP request method to use.
-
fromEndpoint
final ConfigurableTokenSource fromEndpoint(URL url, String method, Map<String, String> headers)
Creates a ConfigurableTokenSource that fetches from a given url using the standard token server format.
- Parameters:
method- the HTTP request method to use.
-
fromSandboxTokenServer
final ConfigurableTokenSource fromSandboxTokenServer(String sandboxId, SandboxTokenServerOptions options)
Creates a ConfigurableTokenSource that fetches from a sandbox token server for credentials, which supports quick prototyping/getting started types of use cases.
Note: This token provider is insecure and should not be used in production.
-
-
-
-