Skip to content

Commit e806cff

Browse files
committed
updated isClientCapableOfClaimsChallenge function
1 parent ce710bb commit e806cff

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -223,22 +223,16 @@ else
223223
### [JavaScript](#tab/JavaScript)
224224

225225
```javascript
226-
const checkForRequiredAuthContext = (req, res, next, authContextId) => {
226+
const checkIsClientCapableOfClaimsChallenge = (req, res, next) => {
227227
// req.authInfo contains the decoded access token payload
228-
if (isClientCapableOfClaimsChallenge(req.authInfo)) {
228+
if (req.authInfo['xms_cc'] && req.authInfo['xms_cc'].includes('CP1')) {
229229
// Return formatted claims challenge as this client understands this
230+
230231
} else {
231232
return res.status(403).json({ error: 'Client is not capable' });
232233
}
233234
}
234235

235-
const isClientCapableOfClaimsChallenge = (accessTokenClaims) => {
236-
if (accessTokenClaims['xms_cc'] && accessTokenClaims['xms_cc'].includes('CP1')) {
237-
return true;
238-
}
239-
240-
return false;
241-
}
242236
```
243237

244238
---

0 commit comments

Comments
 (0)