The major advantage of Atlas is its ability to preform authentication, via Single Sign On, and
render a satellite application’s shell, or all common components that every satellite application
must have. A call to liftoff will ensure the user is authenticated and will start
the process rendering of the shell. This process can take some time thus the call returns a
promise that is resolved when the shell is finished rendering.
Promise Required
Your application must wait for the promise to be resolved before displaying any account / user
specific information.
var promise = atlas.liftoff({
env: "prod",
mainNavId: "Assgined by Platform"
});
promise.done( function(contexts) {
// observable username and bearerToken
authContext = contexts.authContext();
// observable account, branding, and support information
accountContext = contexts.accountContext();
});
If not present in the DOM launch will add the account-switcher,
brand-bar, and main-nav 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>
<account-switcher></account-switcher>
<brand-bar></brand-bar>
<main-nav></main-nav>
<main>
<!-- Your Content Here -->
</main>
<!-- Scripts -->
</body>
Configuration Parameters
Name
Type
Required
Description
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 main-nav. This is assigned to a satellite application by the platform team when the menu item is added.
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.
callbackURL
string
no
[not recommended] Url that auth0 will navigate to after authentication
returnUrl
string
no
[not recommended] Url that the user will be sent to after auth0 and atlas authentication
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
includeAccountContextAndRenderShell
boolean
no
[not recommended] Will calls be made to fetch the accountContext and render the shell
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