mirror of
https://github.com/element-hq/synapse.git
synced 2025-03-14 09:45:51 +00:00
OIDC: increase length of generated nonce
parameter from 30->32 chars (#18109)
This commit is contained in:
parent
6ec5e13ec9
commit
b41a9ebb38
2 changed files with 16 additions and 1 deletions
1
changelog.d/18109.misc
Normal file
1
changelog.d/18109.misc
Normal file
|
@ -0,0 +1 @@
|
|||
Increase the length of the generated `nonce` parameter when perfoming OIDC logins to comply with the TI-Messenger spec.
|
|
@ -1002,7 +1002,21 @@ class OidcProvider:
|
|||
"""
|
||||
|
||||
state = generate_token()
|
||||
nonce = generate_token()
|
||||
|
||||
# Generate a nonce 32 characters long. When encoded with base64url later on,
|
||||
# the nonce will be 43 characters when sent to the identity provider.
|
||||
#
|
||||
# While RFC7636 does not specify a minimum length for the `nonce`
|
||||
# parameter, the TI-Messenger IDP_FD spec v1.7.3 does require it to be
|
||||
# between 43 and 128 characters. This spec concerns using Matrix for
|
||||
# communication in German healthcare.
|
||||
#
|
||||
# As increasing the length only strengthens security, we use this length
|
||||
# to allow TI-Messenger deployments using Synapse to satisfy this
|
||||
# external spec.
|
||||
#
|
||||
# See https://github.com/element-hq/synapse/pull/18109 for more context.
|
||||
nonce = generate_token(length=32)
|
||||
code_verifier = ""
|
||||
|
||||
if not client_redirect_url:
|
||||
|
|
Loading…
Add table
Reference in a new issue