Atlas is initialized by calling the liftoff() method on the
Atlas global. There are a number of options, some mandatory,
that need to be configured specifically for your satellite application. If
you are not using Atlas for authentication with Auth0, you also need to be
certain that the user is authenticated and pass their username and bearer
token to Atlas during liftoff.
The liftoff method returns a promise that is resolved once the
shell has finished rendering.
If you are using Atlas for authentication with Auth0, your application
must wait for the promise to resolve before displaying any account
or user information.
Resolved Promise
After liftoff, Atlas will resolve a promise with an object that contains
2 observable contexts: authContext and accountContext.
For example:
Atlas.liftoff(options).then(function(contexts) {
// observable username and bearerToken
authContext = contexts.authContext();
// observable account, branding, and support information
accountContext = contexts.accountContext();
});
Required DOM Nodes
If not already present in the DOM at the tiem of liftoff, Atlas will add
atlas-account-switcher, atlas-header, and
atlas-navigation nodes for you. However, to prevent flashing
when the nodes are added it is best practice to include them in the
satellite application markup.
...
<body>
<atlas-account-switcher></atlas-account-switcher>
<atlas-header></atlas-header>
<atlas-navigation></atlas-navigation>
<main>
<!-- Your Content Here -->
</main>
</body>
...
Configuration Parameters
Name
Type
Required
Description
accountAlias
string | observable string
no
If the accountAlias is known ahead of time, for instance becuase it is in the URL, this will seed the accountContext.
authenticationEnabled
boolean
no
Default value is false. When enabled, Auth0 will be used to manage authentication.
bearerToken
string
yes
The bearer token of the currently authenticated user. Only required if not using Auth0 for authentication.
callbackURL
string
no
[not recommended] Url that auth0 will navigate to after authentication
env
string | object
yes
Valid values are dev, ppe, or prod. An object may be passed for custom enviroments, it must contain the following values auth0ClientID, auth0Domain, controlBaseUrl
mainNavId
string | observable string
no
The id of the menu to select in the atlas-navigation. This is assigned to a satellite application by the platform team when the menu item is added.
onLogin
function
no
Will be called with the authContext. Can be used to set server side cookies
onLogout
function
no
Will be called when the user logs out, can be used to clear server side cookies
returnUrl
string
no
[not recommended] Url that the user will be sent to after auth0 and atlas authentication
servicesMenuEnabled
boolean
no
When not specified, Atlas will check with the Assets Server for the default value for this setting. This requires useLegacyStyles to be disabled.
useLegacyStyles
boolean
no
When not specified, Atlas will check with the Assets Server for the default value for this setting.
username
string
yes
The username of the currently authenticated user. Only required if not using Auth0 for authentication.
Resolved Data Properties
Name
Type
Description
authContext
observable authContext
An observable authContext model
accountContext
Observable accountContext
An observable accountContext model
AuthContext Model
Name
Type
Description
username
string
The currently authenticated user's username
bearerToken
string
The currently authenticated user's bearerToken
AccountContext Model
Name
Type
Description
accountAlias
string
current Account Alias, will either be the root or the impersonated account