mirror of
https://github.com/pfzetto/axum-oidc.git
synced 2025-12-07 16:35:17 +01:00
fix: issuer URL at / path
Previously the issuer url was received as an http::Uri. When it was converted into a String, a `/` was appended which caused the IssuerURL validation check in openidconnect to fail. Now the IssuerURL is received as a String.
This commit is contained in:
parent
19adcbabd2
commit
fa5faed004
2 changed files with 3 additions and 7 deletions
|
|
@ -42,11 +42,7 @@ pub async fn run(
|
|||
if let Some(client_secret) = client_secret {
|
||||
oidc_client = oidc_client.with_client_secret(client_secret);
|
||||
}
|
||||
let oidc_client = oidc_client
|
||||
.discover(Uri::from_maybe_shared(issuer).expect("valid issuer URI"))
|
||||
.await
|
||||
.unwrap()
|
||||
.build();
|
||||
let oidc_client = oidc_client.discover(issuer).await.unwrap().build();
|
||||
|
||||
let oidc_auth_service = ServiceBuilder::new()
|
||||
.layer(HandleErrorLayer::new(|e: MiddlewareError| async {
|
||||
|
|
|
|||
|
|
@ -195,12 +195,12 @@ impl<AC: AdditionalClaims> Builder<AC, ClientCredentials, (), HttpClient, Redire
|
|||
/// discover issuer details
|
||||
pub async fn discover(
|
||||
self,
|
||||
issuer: impl Into<Uri>,
|
||||
issuer: String,
|
||||
) -> Result<
|
||||
Builder<AC, ClientCredentials, OpenidconnectClient<AC>, HttpClient, RedirectUrl>,
|
||||
Error,
|
||||
> {
|
||||
let issuer_url = IssuerUrl::new(issuer.into().to_string())?;
|
||||
let issuer_url = IssuerUrl::new(issuer)?;
|
||||
let http_client = self.http_client.0.clone();
|
||||
let provider_metadata = ProviderMetadata::discover_async(issuer_url, &http_client);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue