diff options
author | metamuffin <metamuffin@disroot.org> | 2024-08-24 00:56:36 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-08-24 00:56:36 +0200 |
commit | 15bed505386224d42b144da8d3cf56b418a29610 (patch) | |
tree | 4fd37366c37c0d49673e9e9127687860892e74a6 /src/modules | |
parent | dda4b58240f4da737ae371264aa7ad1c7c8fbf98 (diff) | |
download | gnix-15bed505386224d42b144da8d3cf56b418a29610.tar gnix-15bed505386224d42b144da8d3cf56b418a29610.tar.bz2 gnix-15bed505386224d42b144da8d3cf56b418a29610.tar.zst |
customize scope
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/auth/openid.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/auth/openid.rs b/src/modules/auth/openid.rs index a8d9d6e..7253ba8 100644 --- a/src/modules/auth/openid.rs +++ b/src/modules/auth/openid.rs @@ -42,6 +42,7 @@ pub struct OpenIDAuth { client_id: String, authorize_endpoint: String, token_endpoint: String, + scope: String, next: DynNode, } @@ -153,13 +154,14 @@ id_token={id_token:?}"# let redirect_uri = redirect_uri(&request)?.to_string(); let uri = format!( - "{}?client_id={}&redirect_uri={}&state={}_{}&code_challenge={}&code_challenge_method=S256&response_type=code&scope=openid magic", + "{}?client_id={}&redirect_uri={}&state={}_{}&code_challenge={}&code_challenge_method=S256&response_type=code&scope=openid {}", self.authorize_endpoint, utf8_percent_encode(&self.client_id, NON_ALPHANUMERIC), utf8_percent_encode(&redirect_uri, NON_ALPHANUMERIC), hex::encode(verif_cipher), utf8_percent_encode(&request.uri().to_string(), NON_ALPHANUMERIC), base64::engine::general_purpose::URL_SAFE.encode(chal).trim_end_matches("="), + utf8_percent_encode(&self.scope, NON_ALPHANUMERIC), ); info!("redirect {uri:?}"); let mut resp = |