diff --git a/crates/matrix-sdk/src/authentication/oidc/mod.rs b/crates/matrix-sdk/src/authentication/oidc/mod.rs index 8417cb5da..eebc129b8 100644 --- a/crates/matrix-sdk/src/authentication/oidc/mod.rs +++ b/crates/matrix-sdk/src/authentication/oidc/mod.rs @@ -531,7 +531,7 @@ impl Oidc { } tracing::info!("Registering this client for OIDC."); - self.register_client(registrations.verified_metadata.clone(), None).await?; + self.register_client(registrations.verified_metadata.clone()).await?; tracing::info!("Persisting OIDC registration data."); self.store_client_registration(®istrations) @@ -784,13 +784,6 @@ impl Oidc { /// /// * `client_metadata` - The [`VerifiedClientMetadata`] to register. /// - /// * `software_statement` - A [software statement], a digitally signed - /// version of the metadata, as a JWT. Any claim in this JWT will override - /// the corresponding field in the client metadata. It must include a - /// `software_id` claim that is used to uniquely identify a client and - /// ensure the same `client_id` is returned on subsequent registration, - /// allowing to update the registered client metadata. - /// /// The client ID in the response should be persisted for future use and /// reused for the same authorization server, identified by the /// [`Oidc::issuer()`], along with the client metadata sent to the provider, @@ -822,7 +815,7 @@ impl Oidc { /// } /// /// let response = oidc - /// .register_client(client_metadata.clone(), None) + /// .register_client(client_metadata.clone()) /// .await?; /// /// println!( @@ -837,12 +830,9 @@ impl Oidc { /// persist_client_registration(issuer, &client_metadata, &client_id); /// # anyhow::Ok(()) }; /// ``` - /// - /// [software statement]: https://datatracker.ietf.org/doc/html/rfc7591#autoid-8 pub async fn register_client( &self, client_metadata: VerifiedClientMetadata, - software_statement: Option, ) -> Result { let provider_metadata = self.provider_metadata().await?; @@ -851,13 +841,9 @@ impl Oidc { .as_ref() .ok_or(OidcError::NoRegistrationSupport)?; - let registration_response = register_client( - &self.http_service(), - registration_endpoint, - client_metadata, - software_statement, - ) - .await?; + let registration_response = + register_client(&self.http_service(), registration_endpoint, client_metadata, None) + .await?; // The format of the credentials changes according to the client metadata that // was sent. Public clients only get a client ID. diff --git a/crates/matrix-sdk/src/authentication/oidc/qrcode/login.rs b/crates/matrix-sdk/src/authentication/oidc/qrcode/login.rs index 6fb47377b..8ebc44f86 100644 --- a/crates/matrix-sdk/src/authentication/oidc/qrcode/login.rs +++ b/crates/matrix-sdk/src/authentication/oidc/qrcode/login.rs @@ -285,7 +285,7 @@ impl<'a> LoginWithQrCode<'a> { /// Register the client with the OAuth 2.0 authorization server. async fn register_client(&self) -> Result<(), DeviceAuthorizationOauthError> { let oidc = self.client.oidc(); - oidc.register_client(self.client_metadata.clone(), None).await?; + oidc.register_client(self.client_metadata.clone()).await?; Ok(()) } diff --git a/crates/matrix-sdk/src/authentication/oidc/tests.rs b/crates/matrix-sdk/src/authentication/oidc/tests.rs index fd7ccf73d..1decd6f7e 100644 --- a/crates/matrix-sdk/src/authentication/oidc/tests.rs +++ b/crates/matrix-sdk/src/authentication/oidc/tests.rs @@ -481,7 +481,7 @@ async fn test_register_client() { .mount() .await; - let result = oidc.register_client(client_metadata.clone(), None).await; + let result = oidc.register_client(client_metadata.clone()).await; assert_matches!(result, Err(OidcError::NoRegistrationSupport)); server.verify_and_reset().await; @@ -496,7 +496,7 @@ async fn test_register_client() { .await; oauth_server.mock_registration().ok().expect(1).named("registration").mount().await; - let response = oidc.register_client(client_metadata, None).await.unwrap(); + let response = oidc.register_client(client_metadata).await.unwrap(); assert_eq!(response.client_id, "test_client_id"); let auth_data = oidc.data().unwrap(); diff --git a/examples/oidc_cli/src/main.rs b/examples/oidc_cli/src/main.rs index 131c00ae5..2f34f5678 100644 --- a/examples/oidc_cli/src/main.rs +++ b/examples/oidc_cli/src/main.rs @@ -210,7 +210,7 @@ impl OidcCli { // to update the metadata later without changing the client ID, but requires to // have a way to serve public keys online to validate the signature of // the JWT. - let res = oidc.register_client(metadata.clone(), None).await?; + let res = oidc.register_client(metadata.clone()).await?; println!("\nRegistered successfully");