@@ -103,7 +103,7 @@ _clientApp = PublicClientApplicationBuilder.Create(App.ClientId)
103
103
.WithDefaultRedirectUri ()
104
104
.WithAuthority (authority )
105
105
.WithClientCapabilities (new [] {" cp1" })
106
- .Build ();*
106
+ .Build ();
107
107
```
108
108
109
109
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
112
112
{
113
113
" AzureAd" : {
114
114
" 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...
118
118
},
119
119
```
120
120
#### [JavaScript](#tab/JavaScript)
121
121
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 .
123
123
124
124
```javascript
125
125
const msalConfig = {
126
126
auth : {
127
127
clientId : 'Enter_the_Application_Id_Here' ,
128
128
clientCapabilities : [" CP1" ]
129
- // the remaining settings
130
- // ...
129
+ // remaining settings...
131
130
}
132
131
}
133
132
@@ -222,14 +221,15 @@ else
222
221
223
222
### [JavaScript](#tab/JavaScript)
224
223
224
+ The following snippet illustrates a custom Express .js middleware :
225
+
225
226
```javascript
226
227
const checkIsClientCapableOfClaimsChallenge = (req , res , next ) => {
227
228
// req.authInfo contains the decoded access token payload
228
229
if (req .authInfo ['xms_cc' ] && req .authInfo ['xms_cc' ].includes ('CP1' )) {
229
230
// Return formatted claims challenge as this client understands this
230
-
231
231
} else {
232
- return res .status (403 ).json ({ error : 'Client is not capable' });
232
+ return res .status (403 ).json ({ error : 'Client is not capable' });
233
233
}
234
234
}
235
235
0 commit comments