You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -376,11 +376,14 @@ Allows test code to dynamically configure the responses returned by the OAuth2 e
376
376
"error_scenario": {
377
377
"endpoint": "token",
378
378
"error": "invalid_grant",
379
-
"error_description": "Custom error for testing"
379
+
"error_description": "Custom error for testing",
380
+
"enabled": true
380
381
}
381
382
}
382
383
```
383
384
385
+
**Note**: The `enabled` field is optional and defaults to `true` when `endpoint` and `error` are provided. To explicitly disable an error scenario, set `"enabled": false`.
386
+
384
387
**Response**:
385
388
386
389
```json
@@ -392,6 +395,30 @@ Allows test code to dynamically configure the responses returned by the OAuth2 e
392
395
393
396
**IMPORTANT**: To update user information that will be returned by the `/userinfo` endpoint, you must include the user profile data inside the `tokens.user_info` object, not in the top-level `user_info` field. The top-level `user_info` field updates a different user object that is not used by the `/userinfo` endpoint.
394
397
398
+
**Error Scenario Configuration**:
399
+
400
+
The `error_scenario` object supports the following OAuth2 error codes for testing:
401
+
402
+
**Authorize endpoint errors:**
403
+
-`access_denied` - User denied access
404
+
-`unauthorized_client` - Client not authorized for this grant type
405
+
-`invalid_scope` - Requested scope is invalid or unknown
406
+
-`temporarily_unavailable` - Server is temporarily unavailable
407
+
-`invalid_request` - Request is missing a required parameter or malformed
408
+
-`unsupported_response_type` - Response type is not supported
409
+
-`server_error` - Internal server error occurred
410
+
411
+
**Token endpoint errors:**
412
+
-`invalid_grant` - Invalid authorization code or credentials
413
+
-`invalid_client` - Client authentication failed
414
+
-`unsupported_grant_type` - Grant type is not supported
415
+
-`invalid_request` - Request is malformed
416
+
417
+
**Userinfo endpoint errors:**
418
+
-`invalid_token` - Access token is invalid or expired
0 commit comments