Skip to content

Commit

Permalink
#1056 - auto-strip .well-known/openid-configuration from OIDC URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Oct 4, 2024
1 parent 38bdbad commit 7e49f13
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion warpgate-sso/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
}

Expand Down

0 comments on commit 7e49f13

Please sign in to comment.