Skip to content

Commit

Permalink
Keep issuer url in client
Browse files Browse the repository at this point in the history
  • Loading branch information
sbihel committed Oct 17, 2023
1 parent a91e5cd commit 22eb844
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/authorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ mod test {

let client = crate::core::client::Client::new(
ClientId::new("s6BhdRkqt3".to_string()),
IssuerUrl::new("https://server.example.com".into()).unwrap(),
CredentialUrl::new("https://server.example.com/credential".into()).unwrap(),
AuthUrl::new("https://server.example.com/authorize".into()).unwrap(),
TokenUrl::new("https://server.example.com/token".into()).unwrap(),
Expand Down
7 changes: 6 additions & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use openidconnect::{
CoreSubjectIdentifierType, CoreTokenType,
},
registration::ClientMetadata,
JsonWebKeyType, JweContentEncryptionAlgorithm, JweKeyManagementAlgorithm,
IssuerUrl, JsonWebKeyType, JweContentEncryptionAlgorithm, JweKeyManagementAlgorithm,
};
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -44,6 +44,7 @@ where
StandardRevocableToken,
BasicRevocationErrorResponse,
>,
issuer: IssuerUrl,
credential_endpoint: CredentialUrl,
batch_credential_endpoint: Option<BatchCredentialUrl>,
deferred_credential_endpoint: Option<DeferredCredentialUrl>,
Expand All @@ -64,6 +65,7 @@ where
{
pub fn new(
client_id: ClientId,
issuer: IssuerUrl,
credential_endpoint: CredentialUrl,
auth_url: AuthUrl,
token_url: TokenUrl,
Expand All @@ -73,6 +75,7 @@ where
.set_redirect_uri(redirect_uri);
Self {
inner,
issuer,
credential_endpoint,
batch_credential_endpoint: None,
deferred_credential_endpoint: None,
Expand All @@ -87,6 +90,7 @@ where

field_getters_setters![
pub self [self] ["issuer metadata value"] {
set_issuer -> issuer[IssuerUrl],
set_credential_endpoint -> credential_endpoint[CredentialUrl],
set_batch_credential_endpoint -> batch_credential_endpoint[Option<BatchCredentialUrl>],
set_deferred_credential_endpoint -> deferred_credential_endpoint[Option<DeferredCredentialUrl>],
Expand All @@ -106,6 +110,7 @@ where
) -> Self {
Self::new(
client_id,
issuer_metadata.credential_issuer().clone(),
issuer_metadata.credential_endpoint().clone(),
authorization_metadata.authorization_endpoint().clone(),
authorization_metadata.token_endpoint().clone(),
Expand Down

0 comments on commit 22eb844

Please sign in to comment.