1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-07 17:03:01 +03:00

Load the additional OAuth parameters from the config

This commit is contained in:
Quentin Gliech
2024-03-01 12:14:53 +01:00
parent 1821136e3f
commit 25fbbf96b9
3 changed files with 19 additions and 3 deletions

View File

@@ -310,8 +310,10 @@ async fn sync(root: &super::Options, prune: bool, dry_run: bool) -> anyhow::Resu
jwks_uri_override: provider.jwks_uri,
discovery_mode,
pkce_mode,
// TODO: get that from the config
additional_authorization_parameters: Vec::new(),
additional_authorization_parameters: provider
.additional_authorization_parameters
.into_iter()
.collect(),
},
)
.await?;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use std::ops::Deref;
use std::{ops::Deref, collections::BTreeMap};
use async_trait::async_trait;
use mas_iana::{jose::JsonWebSignatureAlg, oauth::OAuthClientAuthenticationMethod};
@@ -302,6 +302,12 @@ pub struct Provider {
/// provider
#[serde(default)]
pub claims_imports: ClaimsImports,
/// Additional parameters to include in the authorization request
///
/// Orders of the keys are not preserved.
#[serde(default)]
pub additional_authorization_parameters: BTreeMap<String, String>,
}
impl Deref for Provider {

View File

@@ -2084,6 +2084,14 @@
"$ref": "#/definitions/ClaimsImports"
}
]
},
"additional_authorization_parameters": {
"description": "Additional parameters to include in the authorization request\n\nOrders of the keys are not preserved.",
"default": {},
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
},