You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-11-21 23:00:50 +03:00
Append additional parameters to the OAuth2 authorize endpoint
This commit is contained in:
@@ -107,12 +107,21 @@ pub(crate) async fn get(
|
||||
};
|
||||
|
||||
// Build an authorization request for it
|
||||
let (url, data) = mas_oidc_client::requests::authorization_code::build_authorization_url(
|
||||
let (mut url, data) = mas_oidc_client::requests::authorization_code::build_authorization_url(
|
||||
lazy_metadata.authorization_endpoint().await?.clone(),
|
||||
data,
|
||||
&mut rng,
|
||||
)?;
|
||||
|
||||
// We do that in a block because params borrows url mutably
|
||||
{
|
||||
// Add any additional parameters to the query
|
||||
let mut params = url.query_pairs_mut();
|
||||
for (key, value) in &provider.additional_authorization_parameters {
|
||||
params.append_pair(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
let session = repo
|
||||
.upstream_oauth_session()
|
||||
.add(
|
||||
|
||||
Reference in New Issue
Block a user