Skip to content

Commit 7237535

Browse files
Merge pull request #213258 from derisen/patch-10
Minor clarifications and legibility improvements
2 parents 3d51af4 + 300b359 commit 7237535

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

articles/active-directory/develop/claims-challenge.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ _clientApp = PublicClientApplicationBuilder.Create(App.ClientId)
103103
.WithDefaultRedirectUri()
104104
.WithAuthority(authority)
105105
.WithClientCapabilities(new [] {"cp1"})
106-
.Build();*
106+
.Build();
107107
```
108108

109109
Those using Microsoft.Identity.Web can add the following code to the configuration file:
@@ -112,22 +112,21 @@ Those using Microsoft.Identity.Web can add the following code to the configurati
112112
{
113113
"AzureAd": {
114114
"Instance": "https://login.microsoftonline.com/",
115-
// the remaining settings
116-
// ...
117-
"ClientCapabilities": [ "cp1" ]
115+
"ClientId": 'Enter_the_Application_Id_Here'
116+
"ClientCapabilities": [ "cp1" ],
117+
// remaining settings...
118118
},
119119
```
120120
#### [JavaScript](#tab/JavaScript)
121121

122-
Those using MSAL.js can add `clientCapabilities` property to the configuration object.
122+
Those using MSAL.js or MSAL Node can add `clientCapabilities` property to the configuration object. Note: this option is available to both public and confidential cient applications.
123123

124124
```javascript
125125
const msalConfig = {
126126
auth: {
127127
clientId: 'Enter_the_Application_Id_Here',
128128
clientCapabilities: ["CP1"]
129-
// the remaining settings
130-
// ...
129+
// remaining settings...
131130
}
132131
}
133132

@@ -222,14 +221,15 @@ else
222221

223222
### [JavaScript](#tab/JavaScript)
224223

224+
The following snippet illustrates a custom Express.js middleware:
225+
225226
```javascript
226227
const checkIsClientCapableOfClaimsChallenge = (req, res, next) => {
227228
// req.authInfo contains the decoded access token payload
228229
if (req.authInfo['xms_cc'] && req.authInfo['xms_cc'].includes('CP1')) {
229230
// Return formatted claims challenge as this client understands this
230-
231231
} else {
232-
return res.status(403).json({ error: 'Client is not capable' });
232+
return res.status(403).json({ error: 'Client is not capable' });
233233
}
234234
}
235235

0 commit comments

Comments
 (0)