Muthu Kumar

Muthu Kumar

  • NA
  • 3k
  • 276.4k

How to use MS-Adal in Ionic 3Native?

Jul 5 2018 12:49 AM
In my project i want to authenticate the user using Azure. So i'm used MS Adal ionic native in my project.
refered this site. https://ionicframework.com/docs/native/ms-adal/
I followed all steps properly.Here what iam tried.
My Component File
  1. import { MSAdal, AuthenticationContext, AuthenticationResult } from '@ionic-  
  2. native/ms-adal';  
  3.   
  4. export class AppComponent{   
  5.   
  6.    constructor(private msAdal: MSAdal,platform: ) {  
  7.       let authContext: AuthenticationContext= this.msAdal.createAuthenticationContext('https://login.windows.net/common');  
  8.       authContext.acquireTokenAsync('https://graph.windows.net''13212131232232''http://localhost:8000')  
  9.       .then((authResponse: AuthenticationResult) => {  
  10.          console.log('Token is' , authResponse.accessToken);  
  11.          console.log('Token will expire on', authResponse.expiresOn);  
  12.       })  
  13.       .catch((e: any) =>  
  14.          console.log('Authentication failed', e));  
  15.       });  
  16.    }  
  17. }  
Iam always facing this error only.
I searched lot of thing. None of them useful to solve this problem. So kindly help me to solve this problem. If any help warmly appreciated.

Answers (3)