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`
467
+
* `Algorithm`: `HMAC with SHA-2 256`
468
+
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):
469
+
<details>
470
+
<summary>Code sample</summary>
471
+
472
+
```python
473
+
class CustomOAuth2Validator(OAuth2Validator):
474
+
475
+
def get_additional_claims(self, request):
476
+
return {
477
+
"sub": request.user.email,
478
+
"email": request.user.email,
479
+
"first_name": request.user.first_name,
480
+
"last_name": request.user.last_name,
481
+
}
482
+
```
483
+
</details>
484
+
Your synapse config is then:
485
+
486
+
```yaml
487
+
oidc_providers:
488
+
- idp_id: django_example
489
+
idp_name: "Django Example"
490
+
issuer: "https://example.com/o/"
491
+
client_id: "your-client-id" # CHANGE ME
492
+
client_secret: "your-client-secret" # CHANGE ME
493
+
scopes: ["openid"]
494
+
user_profile_method: "userinfo_endpoint" # needed because oauth-toolkit does not include user information in the authorization response
0 commit comments