adal.js

Cannot set “preAuthorizedApplications” object in new App registrations module through Azure Powershell

家住魔仙堡 提交于 2019-12-11 06:03:30
问题 Short Scenrario : A muti tenant front end javascript (React.JS) Web Application calls a multi tenant ASP.NET Core 2.2 WebAPI from the browser. Authentication: ADAL.js in the front end app takes care of getting a token from either AzureAD1 or AzureAD2 or AzureAD3... when the User signs-in (based on the User's original Azure Active Directory). The User gives consent to the front end Web App ( scope: Sign in and read user profile ) which is delegated to the WebAPI too. ( meaning the user does

Authenticating using OfficeDev/office-js-helpers rather than adal

心已入冬 提交于 2019-12-10 17:55:01
问题 I'm working on an Office Add-in that currently uses adal to obtain an auth token. As I want to use the Fabric front end I am changing it to React and I notice that the officer-js-helpers have implemented authenticators that seem to do the same job as the adal library. Am I correct in this assumption? If so, how do I duplicate this adal config using the office-js-helpers authentication functions: var adalConfig = { instance: 'https://login.microsoftonline.com/', tenant: 'myprivatesite

401 Unauthorized errors when accessing WebApI from AngularJS/ADAL.js client

核能气质少年 提交于 2019-12-08 13:32:52
问题 I've got a self-hosted web api application with an angular front end, and I need to now start authenticating users via Azure Active Directory. I've downloaded the SinglePageApp example and I've set this up and have it running successfully. https://github.com/Azure-Samples/active-directory-angularjs-singlepageapp-dotnet-webapi When applying the necessary changes to my own app, I can successfully redirect the user to the Azure login screen and get back the userProfile using adal.js/adal_angular

ADAL JS not attaching user token while invoking WebApi

无人久伴 提交于 2019-12-08 11:37:36
问题 I am using ADAL JS for authenticating the users against Azure AD. And as I am new to ADAL JS , I started reading with following articles, which I find very informative: Introducing ADAL JS v1 ADAL JavaScript and AngularJS – Deep Dive After reading the articles, I had the impression that ADAL JS intercepts the service calls and if the service url is registered as one of the endpoint in AuthenticationContext configuration, it attaches the JWT token as Authentication Bearer information. However,

ADAL ASP.NET MVC and Angular. Login from ASP .NET MVC

青春壹個敷衍的年華 提交于 2019-12-08 10:08:49
问题 I have an application already written in ASP.NET MVC. We have decided to write new frontend functions in angular and slowly migrate all frontend to angular. But for now we are stuck with both Angular and MVC. The problem we have is that when a user logs on the login is only made on the MVC parts of the application. The access token from the Azure AD is not shared between Angular and ASP.NET MVC. I have installed https://www.npmjs.com/package/adal-angular5 I can login with that package from

Adal.js logging out without a redirect

时间秒杀一切 提交于 2019-12-07 12:50:04
问题 In our current SPA implementation we authenticate against AzureAD using adal.js and upon successful authentication hit our web api to get the authorization data. There are a couple of edge case scenarios where the get authorization data call could fail. In this case we would like to clear out the state/cache created by adal.js. I have tried a few things but I have not not been able to create a clean slate. Here is some code that I have tried. localStorage.clear(); var authContext =

AngularJS + ADAL.JS set Resource ID (Audience)

主宰稳场 提交于 2019-12-07 10:52:38
问题 How can I use adal.js in AngularJS to get a bearer token for the audience https://management.azure.com from my javascript code? I have created a Client application in the AD and set its permissions to allow it to access the "Windows Azure Service Management API". My angularjs code is as follows: adalService.init( { instance: "https://login.windows.net/", tenant: "<something>.onmicrosoft.com", clientId: "<some id>", cacheLocation: 'localStorage', redirectUri: 'http://localhost:63691/index.html

ADAL.js with Multi-Tenant Azure Active Directory

感情迁移 提交于 2019-12-07 05:30:47
问题 The sample code provided for using ADAL.js looks something like this: window.config = { instance: 'https://login.microsoftonline.com/', tenant: '[Enter your tenant here, e.g. contoso.onmicrosoft.com]', clientId: '[Enter your client_id here, e.g. g075edef-0efa-453b-997b-de1337c29185]', postLogoutRedirectUri: window.location.origin, cacheLocation: 'localStorage', localhost. }; var authContext = new AuthenticationContext(config); This works fine, but I'm trying to allow access for a multi-tenant

Angular 2 SPA Azure Active Directory JWT Issue

℡╲_俬逩灬. 提交于 2019-12-05 20:07:51
Wondering if any Azure Active Directory/Angular 2/Adal experts can assist with this. My set up is as follows: Azure Active Directory with three app registrations. One for the Web API, one for a WPF application and one for an Angular 2 Application. The configuration for the Web API looks fairly standard: <add key="ida:Tenant" value="<tenant>" /> <add key="ida:Audience" value="<ResourceURI>" /> The configuration for the WPF application (which is working) is <add key="ida:AADInstance" value="https://login.windows.net/{0}"/> <add key="ida:Tenant" value="<tenant>" /> <add key="ida:RedirectUri"

AngularJS + ADAL.JS set Resource ID (Audience)

邮差的信 提交于 2019-12-05 13:06:17
How can I use adal.js in AngularJS to get a bearer token for the audience https://management.azure.com from my javascript code? I have created a Client application in the AD and set its permissions to allow it to access the "Windows Azure Service Management API". My angularjs code is as follows: adalService.init( { instance: "https://login.windows.net/", tenant: "<something>.onmicrosoft.com", clientId: "<some id>", cacheLocation: 'localStorage', redirectUri: 'http://localhost:63691/index.html#/configure', endpoints: { /* 'target endpoint to be called': 'target endpoint's resource ID' */ 'https