Merge pull request #3443 from vector-im/feature/bca/stable_endpoint_2858

stable ids for MSC 2858
This commit is contained in:
Benoit Marty 2021-06-01 16:17:20 +02:00 committed by GitHub
commit 34a2d813cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 11 deletions

View File

@ -51,12 +51,12 @@ data class SsoIdentityProvider(
) : Parcelable, Comparable<SsoIdentityProvider> { ) : Parcelable, Comparable<SsoIdentityProvider> {
companion object { companion object {
const val BRAND_GOOGLE = "org.matrix.google" const val BRAND_GOOGLE = "google"
const val BRAND_GITHUB = "org.matrix.github" const val BRAND_GITHUB = "github"
const val BRAND_APPLE = "org.matrix.apple" const val BRAND_APPLE = "apple"
const val BRAND_FACEBOOK = "org.matrix.facebook" const val BRAND_FACEBOOK = "facebook"
const val BRAND_TWITTER = "org.matrix.twitter" const val BRAND_TWITTER = "twitter"
const val BRAND_GITLAB = "org.matrix.gitlab" const val BRAND_GITLAB = "gitlab"
} }
override fun compareTo(other: SsoIdentityProvider): Int { override fun compareTo(other: SsoIdentityProvider): Int {

View File

@ -33,7 +33,6 @@ internal const val REGISTER_FALLBACK_PATH = "/_matrix/static/client/register/"
* Ref: https://matrix.org/docs/spec/client_server/latest#sso-client-login * Ref: https://matrix.org/docs/spec/client_server/latest#sso-client-login
*/ */
internal const val SSO_REDIRECT_PATH = "/_matrix/client/r0/login/sso/redirect" internal const val SSO_REDIRECT_PATH = "/_matrix/client/r0/login/sso/redirect"
internal const val MSC2858_SSO_REDIRECT_PATH = "/_matrix/client/unstable/org.matrix.msc2858/login/sso/redirect"
internal const val SSO_REDIRECT_URL_PARAM = "redirectUrl" internal const val SSO_REDIRECT_URL_PARAM = "redirectUrl"

View File

@ -88,11 +88,9 @@ internal class DefaultAuthenticationService @Inject constructor(
return buildString { return buildString {
append(homeServerUrlBase) append(homeServerUrlBase)
if (providerId != null) {
append(MSC2858_SSO_REDIRECT_PATH)
append("/$providerId")
} else {
append(SSO_REDIRECT_PATH) append(SSO_REDIRECT_PATH)
if (providerId != null) {
append("/$providerId")
} }
// Set the redirect url // Set the redirect url
appendParamToUrl(SSO_REDIRECT_URL_PARAM, redirectUrl) appendParamToUrl(SSO_REDIRECT_URL_PARAM, redirectUrl)

View File

@ -42,7 +42,7 @@ internal data class LoginFlow(
* the client can show a button for each of the supported providers * the client can show a button for each of the supported providers
* See MSC #2858 * See MSC #2858
*/ */
@Json(name = "org.matrix.msc2858.identity_providers") @Json(name = "identity_providers")
val ssoIdentityProvider: List<SsoIdentityProvider>? = null val ssoIdentityProvider: List<SsoIdentityProvider>? = null
) )

1
newsfragment/3442.bugfix Normal file
View File

@ -0,0 +1 @@
Switch to stable endpoint/fields for MSC2858