# Ionic 4: Authentication with MS ADAL

**URL:** <https://forum.ionicframework.com/t/ionic-4-authentication-with-ms-adal/176165>\
**Category:** Ionic Native\
**Created:** [October 23, 2019, 1:47pm UTC](https://forum.ionicframework.com/t/ionic-4-authentication-with-ms-adal/176165 "2019-10-23T13:47:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anton\_klochko](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@anton\_klochko](https://forum.ionicframework.com/u/anton_klochko)\
**Post date:** [October 23, 2019, 1:47pm UTC](https://forum.ionicframework.com/t/ionic-4-authentication-with-ms-adal/176165/1 "2019-10-23T13:47:46Z")

</div>

Hi all ! Could anyone suggest please, if exist way to implement authentication with MS ADAL in Ionic 4? If anyone has working example? I try to use such code, but after authentication it dose not redirect back to my App.

```auto
let authContext: AuthenticationContext = this.msAdal.createAuthenticationContext('https://login.windows.net/common');

    authContext.acquireTokenAsync('https://graph.windows.net', 'ClinetID', 'http://localhost:8000','','')
        .then((authResponse: AuthenticationResult) => {
          console.log('Token is' , authResponse.accessToken);
          console.log('Token will expire on', authResponse.expiresOn);
        })
        .catch((e: any) => console.log('Authentication failed', e));

```
