#1056 - auto-strip .well-known/openid-configuration from OIDC URLs

This commit is contained in:
Eugene 2024-10-04 17:22:40 +02:00
parent 38bdbade69
commit 7e49f13084
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4

View file

@ -153,7 +153,16 @@ impl SsoInternalProviderConfig {
SsoInternalProviderConfig::Azure { tenant, .. } => {
IssuerUrl::new(format!("https://login.microsoftonline.com/{tenant}/v2.0"))?
}
SsoInternalProviderConfig::Custom { issuer_url, .. } => issuer_url.clone(),
SsoInternalProviderConfig::Custom { issuer_url, .. } => {
let mut url = issuer_url.url().clone();
let path = url.path();
let path = path
.strip_suffix(".well-known/openid-configuration")
.unwrap_or(path)
.to_owned();
url.set_path(&path);
IssuerUrl::from_url(url)
}
})
}