I'm currently utilizing the library [email protected] for an Angular 6 project. I am attempting to achieve the following:
If a silent login (login without requiring user input) with Office365 is achievable, then perform a silent login (using
_adalService.login()
)If a silent login is not possible, then display a "login" button on a welcome screen.
A silent login would be feasible if I am authenticated to Azure AD / O365 and the cookie is still valid.
In order to determine if a silent login is viable, I tried the following:
try {
let token = await this._adal.acquireToken(this._config.clientId).toPromise();
return true;
} catch (e) {
console.log('acquireToken error', e);
return false;
}
However, it consistently returns:
User login is required
Yet, calling _adalService.login()
successfully performs a silent login.
My query: How can I determine if adaljs can execute a login without requesting user credentials (perhaps by retrieving information from an o365-cookie)?