adal.js

Angular HTTP Interceptor how to chain an observable

孤街醉人 提交于 2019-12-19 09:47:42
问题 I am using the Azure AD adal library to do authentication. There is a call to aquire a token that returns an observable. How can this observable be added into the intercept? In the below example, how can I get the request that is set inside the subscribe to be returned as the Observable? intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { this.authAzureService.getAccessToken() .subscribe(token => { // I need this to be returned request = this

ADAL.js - Obtaining Microsoft Graph Access Token with id_token

懵懂的女人 提交于 2019-12-19 08:07:34
问题 I am attempting to integrate Azure AD login and Graph API into my angular2 website. I have successfully implemented an ADAL login and redirect, built around a useful blog post here From this I retrieved an id_token parameter that my adalservice can access. Currently this is acheived through a simple context.login() and catching the token in the redirect. When I use this token to try and access Microsoft Graph, I receive an InvalidAuthenticationToken response stating Access Token validation

Adal JS - Logout of just one AD site

泄露秘密 提交于 2019-12-14 03:05:17
问题 I'm working on a SPA that is utilizing ADAL JS. After calling adalService.logOut(), the user is properly redirected to the microsoft oauth logout URL and logout happens just fine. However, the user is logged out of all Microsoft 365 sites and all other sites utilizing ADAL. Is there a way to only the log the user out of this one site? 回答1: Unfortunately, the way the ADAL JS library works is just as you described. When the logout function is called it clears the entire cache. Per the Wiki :

How to decode Azure B2C cookie

十年热恋 提交于 2019-12-12 18:57:03
问题 I have hard time making my Azure B2C renewing procedure work. So if my cookie is visible when I access the login url (login.microsoftonline.com), under x-ms-cpim-sso:myApp.onmicrosoft.com_0, is there a way to decode its value? I would like to see when it expires and other related iformation. 来源: https://stackoverflow.com/questions/48328607/how-to-decode-azure-b2c-cookie

angular 5 adal.js automatic token renew in load angular twice or more

谁说胖子不能爱 提交于 2019-12-12 13:26:08
问题 I have tried a number of angular-adal libraries but the renew of the token is not automatic done. This the configuration I used. In package.json "@types/adal": "^1.0.29", "@types/adal-angular": "^1.0.0", "adal-angular": "^1.0.17", adal-angular come with two scripts adal.js and adal-angular.js . I think adal.angular.js is only for old angularjs solutions. So I used adal.js and an wrapper @types/adal. and include the adal.js in the .angular-cli.json "scripts": [ "../node_modules/adal-angular

Use ng2-adal to get access token for Microsoft Graph Client

烈酒焚心 提交于 2019-12-12 03:53:29
问题 I'm trying to create an Angular application that uses the Angular 2 ADAL library to login into Azure Active Directory and afterwards call Microsoft Graph Client to retrieve some informations about the current user. Unfortunately the Graph client always returns InvalidAuthenticationToken and I don't know how to further investigate to find the root cause. my.component.ts import { Component, Inject, OnInit } from '@angular/core'; import { PLATFORM_ID } from '@angular/core'; import {

Passport-Azure-Ad seems to run asynchronously (still)

こ雲淡風輕ζ 提交于 2019-12-11 16:57:21
问题 The traditional way of running Passport strategies in nodejs express middleware is: server.get('/api/tasks', passport.authenticate('oauth-bearer', { session: false })); I am using https://tsed.io, ("typescript express decorators") and referencing this passport strategy it is done like: class MyCtrl { @Get('/api/tasks') @UseBefore(passport.authenticate('oauth-bearer', { session: false })) get() { ... } } This works perfectly. you can also run it as a detached middleware. Something like: @Post(

Angularjs Adal and additional claims or properties for Authorization

烂漫一生 提交于 2019-12-11 14:58:52
问题 Scenario is Angularjs 1.6.5 app with a c# WebApi. Authentication is done against AAD with the use of angular-adal.js . Up to now, everything Works perfectly, as users are able to login through AAD and WebApi accepts the token. For this specific app, the roles are in an External application, to which the WebApi has Access. I have been able to add the role claims (after fetching them from the External app) with the use of WindowsAzureActiveDirectoryBearerAuthenticationOptions with the following

Graph Security endpoint throwing an HTTP 403 with ADALJS

半腔热情 提交于 2019-12-11 09:05:11
问题 Trying to build a client-side app using the Microsoft Graph Security API. We've made the grants in the Azure Portal, granted Admin Consent, and the JWT is showing the scopes are present (snippet below): "scp": "Calendars.Read MailboxSettings.Read offline_access People.Read profile SecurityEvents.Read.All SecurityEvents.ReadWrite.All User.Read User.Read.All", Here's how we're requesting the token: // acquire token for ms graph. the service we're acquiring a token for // should be the same

Cannot renew access token from B2C, error AADB2C90077

為{幸葍}努か 提交于 2019-12-11 06:58:31
问题 I am experiencing issue trying to obtain a new access token from my AD B2C. From my SPA I use the MSAL.js library (v0.1.3) to authenticate to my AD B2C. After an hour, the access token expires so I do a silent token renew procedure but it fails. I use the following link to get a new access token: https://login.microsoftonline.com/te/myApp.onmicrosoft.com/b2c_1_signin/oauth2/v2.0/authorize?response_type=token&scope=https%3A%2F%2FmyApp.onmicrosoft.com%2Fapi%2Faccount.read%20openid%20profile