passport-azure-ad

How to issue tokens from Azure AD in a Node.js App/API?

耗尽温柔 提交于 2019-12-25 04:14:06
问题 I am building a node app with a express backend. One of the requirements is using Azure AD for authentication. I've installed the passport-azure-ad module and have set it up as the following: import * as passportAD from "passport-azure-ad"; // ... <snip> .... const tenantName = "<MY_TENANT_NAME>""; const clientID = "<MY_CLIENT_ID>"; app.use(passport.initialize()); app.use(passport.session()); const bearerStrategy = new passportAD.BearerStrategy( { identityMetadata: `https://login

Utilizing state/customState with passport-azure-ad

扶醉桌前 提交于 2019-12-08 07:44:52
问题 I'm having trouble figuring out the purpose of customState and if/how I can utilize it to pass data to the return url. Specifically I wish to route the user back to their original location after being signed in. I thought I could pass the original url to the parameter customState and have it returned back to me in the return url POST , but it appears to be encoded or perhaps replaced with a different value. Here is what I want to achieve: Anonymous user visits /page/protected which requires