# MS ADAL Integration

**URL:** <https://forum.ionicframework.com/t/ms-adal-integration/140920>\
**Category:** ionic-v3\
**Created:** [September 6, 2018, 8:21am UTC](https://forum.ionicframework.com/t/ms-adal-integration/140920 "2018-09-06T08:21:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raddy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/raddy/32/121520_2.png) [@raddy](https://forum.ionicframework.com/u/raddy)\
**Post date:** [September 6, 2018, 8:21am UTC](https://forum.ionicframework.com/t/ms-adal-integration/140920/1 "2018-09-06T08:21:53Z")

</div>

Hi all,

Has anyone managed to successfully integrate the Ionic Native MS ADAL?  
I am getting a few errors and I am unsure what I am doing wrong.

home.ts

```auto
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { MSAdal, AuthenticationContext, AuthenticationResult } from '@ionic-native/ms-adal';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html' 
})
export class HomePage {

  userId: string = ' [my email] ';
  constructor(public navCtrl: NavController, private msAdal: MSAdal) {

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

    authContext.acquireTokenAsync('https://graph.windows.net', ' [Application ID] ', 'http://localhost:8000/', this.userId)
      .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)
    );
      
  }

}

```

I am getting “Wrong type for parameter “extraQueryParameters” of AuthenticationContext.acquireTokenAsync: Expected String, but got Function.”

"Authentication failed TypeError: “Wrong type for parameter “extraQueryParameters” of AuthenticationContext.acquireTokenAsync: Expected String, but got Function.”

 ![Capture](https://global.discourse-cdn.com/ionicframework/original/3X/8/6/8619e059db975a9e2678c0c7fb3d8a87f4318f74.png)

Any help is much appreciated 🙂

---

<div class="post-metadata">

**Author:** ![RaphyLi](https://avatars.discourse-cdn.com/v4/letter/r/ccd318/32.png) [@RaphyLi](https://forum.ionicframework.com/u/RaphyLi)\
**Post date:** [September 28, 2018, 7:48am UTC](https://forum.ionicframework.com/t/ms-adal-integration/140920/2 "2018-09-28T07:48:49Z")

</div>

Hi,

I have the same error last month.

You need to add null for the last paramter is not a optional paramter.

```auto
authContext.acquireTokenAsync('https://graph.windows.net', ' [Application ID] ', 'http://localhost:8000/', this.userId, null)

```

---

<div class="post-metadata">

**Author:** ![raddy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/raddy/32/121520_2.png) [@raddy](https://forum.ionicframework.com/u/raddy)\
**Post date:** [December 21, 2018, 12:49pm UTC](https://forum.ionicframework.com/t/ms-adal-integration/140920/3 "2018-12-21T12:49:27Z")

</div>

Thank you that worked. I just didn’t know that the library only works on a device or simulator.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:17pm UTC](https://forum.ionicframework.com/t/ms-adal-integration/140920/4 "2021-07-19T21:17:54Z")

</div>

Closed on July 19, 2021, 9:17pm UTC


