Skip to content
This repository has been archived by the owner. It is now read-only.

Commit 75c0550

Browse files
authored
Updated and corrected Readme.md
1. Correction from microsoftonline.com to b2clogin.com 2. Auth config implementation of B2Cscopes and webapi
1 parent 65d4eec commit 75c0550

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

README.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,35 @@ Now in the sample code, you can replace the single page application's demo envir
138138
1. Open the `index.html` file.
139139
1. Find the assignment for `ClientID` and replace the value with the Application ID for the single page application you registered in Step 4, for example the Application ID found in `My Test SPA` application in the Azure portal.
140140
1. Find the assignment for `authority` and replacing `b2c_1_susi` with the name of the policy you created in Step 2, and `fabrikamb2c.onmicrosoft.com` by the name of your Azure AD B2C tenant, for example `https://<your-tenant-name>.b2clogin.com/<your-tenant-name>.onmicrosoft.com/<your-sign-in-sign-up-policy>`
141-
1. Find the assignment for the scopes `b2cScopes` replacing the URL by the scope URL you created for the Web API, e.g. `b2cScopes: ["https://<your-tenant-name>.onmicrosoft.com/hello/demo.read"]`
142-
2. Find the assignment for API URL `webApi` replacing the current URL by the URL where you deployed your Web API in Step 4, e.g. `webApi: 'http://localhost:5000/hello'`
141+
1. Find the assignment for the scopes `b2cScopes` replacing the URL by the scope URL you created for the Web API, e.g. `b2cScopes: ["https://<your-tenant-name>.onmicrosoft.com/helloapi/demo.read"]`
142+
2. Find the assignment for API URL `webApi` replacing the current URL by the URL where you deployed your Web API in Step 4, e.g. `webApi: "https://fabrikamb2chello.azurewebsites.net/hello"
143143

144144
Your resulting code should look as follows:
145145

146146
```javascript
147147
<script class="pre">
148-
// The current application coordinates were pre-registered in a B2C tenant.
149-
var applicationConfig = {
150-
clientID: '<Application ID for your single page application>',
151-
authority: "https://login.microsoftonline.com/tfp/<your-tenant-name>.onmicrosoft.com/<your-sign-in-sign-up-policy>",
152-
b2cScopes: ["https://<your-tenant-name>.onmicrosoft.com/hello/demo.read"],
153-
webApi: 'http://localhost:5000/hello',
154-
};
155-
</script>
148+
149+
// The current application coordinates were pre-registered in a B2C tenant.
150+
var appConfig = {
151+
b2cScopes: ["https://fabrikamb2c.onmicrosoft.com/helloapi/demo.read"],
152+
webApi: "https://fabrikamb2chello.azurewebsites.net/hello"
153+
};
154+
</script>
155+
156+
const msalConfig = {
157+
auth: {
158+
clientId: "e760cab2-b9a1-4c0d-86fb-ff7084abd902", //This is your client ID
159+
authority: "https://fabrikamb2c.b2clogin.com/fabrikamb2c.onmicrosoft.com/b2c_1_susi", //This is your tenant info
160+
validateAuthority: false
161+
},
162+
cache: {
163+
cacheLocation: "localStorage",
164+
storeAuthStateInCookie: true
165+
}
166+
};
167+
168+
// instantiate MSAL
169+
const myMSALObj = new Msal.UserAgentApplication(msalConfig);
156170
```
157171

158172
### Step 7: Run the sample

0 commit comments

Comments
 (0)