Managing Authentication
This little tutorial will show you how to manage Appmixer SDK authentication.
Introduction
Token management example
// Method called when a login form is submitted
function login(username, password) {
// Request a token from the engine
appmixer.api.authenticate(username, password)
.then((data) => {
// We retrieve the token from the response data object
const { token } = data;
// We set the token onto our SDK instance
appmixer.set('accessToken', token);
// Now this is where we persist our token using the
// sessionStorage. Remember that you can store the token
// pretty much on any storage system you can access from
// your application
sessionStorage.setItem('myAccessToken', token);
// After this you can redirect to home page
})
.catch((err) => {
console.log('Something wrong happened');
console.log(err);
});
}Check token expiration
Multi-user management
Last updated
Was this helpful?
