diff --git a/CHANGELOG.md b/CHANGELOG.md index 3388b2aa..b6177234 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Improvements: * Add media endpoints: `r0::media::{get_media_config, get_media_preview, get_content_as_filename}` * Add `unstable_features` to `unversioned::get_supported_versions` (introduced in r0.5.0) * Add request and response parameters for `r0::account::deactivate` +* Add `r0::session::sso_login` (introduced in r0.5.0) Breaking changes: @@ -17,7 +18,7 @@ Breaking changes: * Add `allow_remote` parameter to `r0::media::get_content` * Add missing parameters for `r0::room::create_room` * Moved `r0::room::create_room::Invite3pid` to `r0::membership::Invite3pid` -* Replaced `user_id` parameter of `r0::membership::invite_user` with `recipient` +* Replaced `user_id` parameter of `r0::membership::invite_user` with `recipient` to allow invitation of users by either Matrix or third party identifiers. * Remove deprecated endpoint `r0::contact::create_contact` (deprecated in r0.6.0) diff --git a/src/r0/session.rs b/src/r0/session.rs index 5096af71..e1df60b8 100644 --- a/src/r0/session.rs +++ b/src/r0/session.rs @@ -4,3 +4,4 @@ pub mod get_login_types; pub mod login; pub mod logout; pub mod logout_all; +pub mod sso_login; diff --git a/src/r0/session/sso_login.rs b/src/r0/session/sso_login.rs new file mode 100644 index 00000000..af6c42d9 --- /dev/null +++ b/src/r0/session/sso_login.rs @@ -0,0 +1,28 @@ +//! [GET /_matrix/client/r0/login/sso/redirect](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-login-sso-redirect) + +use ruma_api::ruma_api; + +ruma_api! { + metadata { + description: "", + method: GET, + name: "sso_login", + path: "/_matrix/client/r0/login/sso/redirect", + rate_limited: false, + requires_authentication: false, + + } + + request { + /// URL to which the homeserver should return the user after completing + /// authentication with the SSO identity provider. + #[ruma_api(query)] + pub redirect_url: String, + } + + response { + /// Redirect URL to the SSO identity provider. + #[ruma_api(header = LOCATION)] + pub location: String, + } +}