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
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
* `Authorization grant type`: `Authorization code`
463
+
* `Algorithm`: `HMAC with SHA-2 256`
464
+
2. You can [customize the claims](https://django-oauth-toolkit.readthedocs.io/en/latest/oidc.html#customizing-the-oidc-responses) Django gives to synapse (optional):
465
+
<details>
466
+
<summary>Code sample</summary>
467
+
468
+
```python
469
+
class CustomOAuth2Validator(OAuth2Validator):
470
+
471
+
def get_additional_claims(self, request):
472
+
return {
473
+
"sub": request.user.email,
474
+
"email": request.user.email,
475
+
"first_name": request.user.first_name,
476
+
"last_name": request.user.last_name,
477
+
}
478
+
```
479
+
</details>
480
+
3. Your synapse config is then:
481
+
482
+
```yaml
483
+
oidc_providers:
484
+
- idp_id: django_example
485
+
idp_name: "Django Example"
486
+
issuer: "https://example.com/o/"
487
+
client_id: "your-client-id" # CHANGE ME
488
+
client_secret: "your-client-secret" # CHANGE ME
489
+
scopes: ["openid"]
490
+
user_profile_method: "userinfo_endpoint" # needed because oauth-toolkit does not include user information in the authorization response
0 commit comments