mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
Merge pull request #3443 from vector-im/feature/bca/stable_endpoint_2858
stable ids for MSC 2858
This commit is contained in:
commit
34a2d813cb
5 changed files with 9 additions and 11 deletions
|
@ -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 {
|
||||||
|
|
|
@ -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"
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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
1
newsfragment/3442.bugfix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Switch to stable endpoint/fields for MSC2858
|
Loading…
Reference in a new issue