adal.js

How to integrate azure ad into a react web app that consumes a REST API in azure too

痴心易碎 提交于 2019-11-27 01:53:51
问题 I have one web app which is React, and I already configured Azure AD Authentication for the web app itself. Its 100% Client site app, no server side components. I used this component: https://github.com/salvoravida/react-adal My code is as follows: adalconfig.js import { AuthenticationContext, adalFetch, withAdalLogin } from 'react-adal'; export const adalConfig = { tenant: 'mytenantguid', clientId: 'myappguid', endpoints: { api: '14d71d65-f596-4eae-be30-27f079bf8d4b', }, cacheLocation:

How to load adal.js in webpack inside Angular 2 (Azure-AD)

試著忘記壹切 提交于 2019-11-26 21:02:07
问题 Inside my NG2 project, if I write: import adal from 'adal-angular'; it gives me 'adal is undefined'. Why is that? I want to use adal.js inside my angular 2 project. I already have run npm install adal-angular --save npm install @types/adal --save Then, inside my component.ts file, if I do: import adal from 'adal-angular'; adal is undefined. How can I import it correctly inside my component.ts file, and also use the typings ? 回答1: To fix this, you will need to do a number of things: npm