You've already forked authentication-service
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:
@@ -310,8 +310,10 @@ async fn sync(root: &super::Options, prune: bool, dry_run: bool) -> anyhow::Resu
|
|||||||
jwks_uri_override: provider.jwks_uri,
|
jwks_uri_override: provider.jwks_uri,
|
||||||
discovery_mode,
|
discovery_mode,
|
||||||
pkce_mode,
|
pkce_mode,
|
||||||
// TODO: get that from the config
|
additional_authorization_parameters: provider
|
||||||
additional_authorization_parameters: Vec::new(),
|
.additional_authorization_parameters
|
||||||
|
.into_iter()
|
||||||
|
.collect(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use std::ops::Deref;
|
use std::{ops::Deref, collections::BTreeMap};
|
||||||
|
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use mas_iana::{jose::JsonWebSignatureAlg, oauth::OAuthClientAuthenticationMethod};
|
use mas_iana::{jose::JsonWebSignatureAlg, oauth::OAuthClientAuthenticationMethod};
|
||||||
@@ -302,6 +302,12 @@ pub struct Provider {
|
|||||||
/// provider
|
/// provider
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub claims_imports: ClaimsImports,
|
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 {
|
impl Deref for Provider {
|
||||||
|
@@ -2084,6 +2084,14 @@
|
|||||||
"$ref": "#/definitions/ClaimsImports"
|
"$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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user