Skip to content

TokenInitializer

Simon Jahreiß edited this page Oct 27, 2016 · 4 revisions

A TokenInitializer can be used to add a token to the request headers in the Authorization field.

Default initializer

Use the following method to create a default TokenInitializer:

Method name Parameters Returns Description

defaultToken

File

TokenInitializer

Uses the token in the specified file.

DC/OS initializer

For DC/OS special TokenInitializers exist. To get more info about the different types of tokens DC/OS uses, click here.

WARNING: The lifetime of the DC/OS tokens is limited. So far there is no possibility to automatically refresh them. Remember to do this manually!

Use the following methods to create special DC/OS TokenInitializers:

Method name Parameter Returns Description

openId

File

TokenInitializer

Reads the OpenId Connect Id token from the specified file, uses it to retrieve a DC/OS authentication token and uses that for authentication. To retrieve your OpenId Connect Id token open https://<public-master-ip>/login?redirect_uri=urn:ietf:wg:oauth:2.0:oob in your browser.

dcosAuthToken

void

TokenInitializer

Reads the DC/OS authentication token from the DC/OS CLI config (~/.dcos/dcos.toml). Here you can find out, how to retrieve your DC/OS authentication token.

Clone this wiki locally