Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b9ee56c authored by Romain Hunault's avatar Romain Hunault 🚴🏻
Browse files

Merge branch '4188os-murena-two-step-oidc' into 'v3.7'

fix(auth): use two-step Murena OIDC flow

See merge request !194
parents ebfe0676 f1f24355
Loading
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -67,7 +67,6 @@ init_submodules:
  stage: gitlab_release
  rules:
    - if: '$CI_COMMIT_REF_PROTECTED == "true"'
    - when: manual
  script:
    - git clone https://gitlab.e.foundation/e/os/system-apps-update-info.git systemAppsUpdateInfo
  artifacts:
+2 −2
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ android {
    def appVersionCode = localProps.getProperty('VERSION_CODE')
    if (appVersionCode == null) {
        // Set initial version code if not present
        appVersionCode = 403900015
        appVersionCode = 403900016
    } else {
        // Increment version code for subsequent builds
        appVersionCode = appVersionCode.toInteger() + 1
@@ -43,7 +43,7 @@ android {
        applicationId "foundation.e.accountmanager"

        versionCode appVersionCode
        versionName '4.3.9-15'
        versionName '4.3.9-16'

        buildConfigField "long", "buildTime", System.currentTimeMillis() + "L"

+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ enum class IdentityProvider(
        clientSecret = null,
        redirectUri = BuildConfig.MURENA_REDIRECT_URI + ":/redirect",
        logoutRedirectUri = BuildConfig.MURENA_LOGOUT_REDIRECT_URI + ":/redirect",
        scope = "openid profile email offline_access",
        scope = "openid profile email",
        userInfoEndpoint = null,
        baseUrl = BuildConfig.MURENA_BASE_URL_PRODUCTION,
    ),
+25 −0
Original line number Diff line number Diff line
package at.bitfire.davdroid.authorization

import net.openid.appauth.AuthState
import net.openid.appauth.AuthorizationException

object MurenaOfflineAccessValidator {

    fun hasUsableOfflineAccess(authState: AuthState): Boolean {
        return hasUsableOfflineAccess(
            accessToken = authState.accessToken,
            refreshToken = authState.refreshToken,
            authorizationException = authState.authorizationException
        )
    }

    internal fun hasUsableOfflineAccess(
        accessToken: String?,
        refreshToken: String?,
        authorizationException: AuthorizationException?
    ): Boolean {
        return authorizationException == null &&
            !accessToken.isNullOrBlank() &&
            !refreshToken.isNullOrBlank()
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -241,6 +241,7 @@ class EeloAuthenticatorFragment : Fragment() {

                putExtra(LoginActivity.USERNAME_HINT, userNameHint)
                putExtra(SettingsActivity.EXTRA_IS_RE_AUTHENTICATING, isReAuthenticating)
                putExtra(LoginActivity.MURENA_OFFLINE_ACCESS_REQUESTED, false)
            }
            navigate(MurenaOpenIdAuthFragment())
        } else if (userId.isNotBlank() && password.isNotBlank() && validate()) {
Loading