Skip to content

Commit d299bcc

Browse files
committed
ready
1 parent cda1305 commit d299bcc

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,9 @@ Open the project in your IDE (like Visual Studio or Visual Studio Code) to confi
133133
> In the steps below, "ClientID" is the same as "Application ID" or "AppId".
134134
135135
1. Open the `config.json` file.
136-
1. Find the key `tenantName` and replace the existing value with your **Azure AD** tenant's name e.g. `<your-tenant-name>.onmicrosoft.com`.
136+
1. Find the key `tenantName` and replace the existing value with your **Azure AD** tenant's name e.g. `fabrikamb2c`.
137137
1. Find the key `clientID` and replace the existing value with the application ID (clientId) of the `active-directory-b2c-javascript-nodejs-webapi` application copied from the **Azure Portal**.
138-
1. Find the key `audience` and replace the existing value with the application ID (clientId) of the `active-directory-b2c-javascript-nodejs-webapi` application copied from the **Azure Portal**.
139138
1. Find the key `policyName` and replace the existing value with name of the policy you've created, e.g. `B2C_1_SUSI`.
140-
1. Find the key `b2cDomain` and replace the existing value with your tenant Domain name e.g. `<your-tenant-name>.b2clogin.com`.
141139

142140
## Running the sample
143141

config.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"credentials": {
3-
"tenantName": "fabrikamb2c.onmicrosoft.com",
4-
"clientID": "93733604-cc77-4a3c-a604-87084dd55348",
5-
"audience": "93733604-cc77-4a3c-a604-87084dd55348"
3+
"tenantName": "fabrikamb2c",
4+
"clientID": "93733604-cc77-4a3c-a604-87084dd55348"
65
},
76
"policies": {
87
"policyName": "B2C_1_SUSI"
@@ -11,7 +10,6 @@
1110
"scope": ["demo.read"]
1211
},
1312
"metadata": {
14-
"b2cDomain": "fabrikamb2c.b2clogin.com",
1513
"authority": "login.microsoftonline.com",
1614
"discovery": ".well-known/openid-configuration",
1715
"version": "v2.0"

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ const config = require('./config.json');
66
const BearerStrategy = require('passport-azure-ad').BearerStrategy;
77

88
const options = {
9-
identityMetadata: `https://${config.metadata.b2cDomain}/${config.credentials.tenantName}/${config.policies.policyName}/${config.metadata.version}/${config.metadata.discovery}`,
9+
identityMetadata: `https://${config.credentials.tenantName}.b2clogin.com/${config.credentials.tenantName}.onmicrosoft.com/${config.policies.policyName}/${config.metadata.version}/${config.metadata.discovery}`,
1010
clientID: config.credentials.clientID,
11+
audience: config.credentials.clientID,
1112
policyName: config.policies.policyName,
1213
isB2C: config.settings.isB2C,
1314
validateIssuer: config.settings.validateIssuer,

0 commit comments

Comments
 (0)