小编Rat*_*a S的帖子

如何在离子项目中使用离子原生 - MS Adal?

我是Ionic的新手,我想使用Azure对用户进行身份验证.所以我在我的项目中使用MS ADAL Ionic Native.我在网上找不到合适的例子.这是我的app.component.ts

import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { MSAdal, AuthenticationContext, AuthenticationResult } from '@ionic- 
native/ms-adal';

import { HomePage } from '../pages/home/home';
@Component({
templateUrl: 'app.html'
})
export class MyApp {
  rootPage:any = HomePage;

  constructor(private msAdal: MSAdal,platform: Platform, statusBar: 
              StatusBar, splashScreen: SplashScreen) {
       platform.ready().then(() => {

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

  authContext.acquireTokenAsync('https://graph.windows.net', '[My-appID]', 'http://localhost:8000')
    .then((authResponse: AuthenticationResult) => {
       console.log('Token is' , …
Run Code Online (Sandbox Code Playgroud)

typescript adal ionic-framework angular

8
推荐指数
1
解决办法
1079
查看次数

标签 统计

adal ×1

angular ×1

ionic-framework ×1

typescript ×1