From 1719ab5964489871303bdcf9267dfa4343951696 Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Wed, 7 May 2025 13:16:32 +0600 Subject: [PATCH 1/2] fix: pass clientId on oidc logout flow, so can logout properly when IdToken is missing for latest keycloak version, if the post_logout_redirect_uri is used, then we have to pass id_token_hint / client_id. But, id_token_hint can not initialized when refresh token happens / new login happens. In these cases, we want to pass client_id. For more details: https://dev.to/austincunningham/keycloak-1901-and-setting-the-idtokenhint-220c issue: https://gitlab.e.foundation/e/infra/backlog/-/issues/4162 --- .../ui/signout/OpenIdEndSessionActivity.kt | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/app/src/main/kotlin/at/bitfire/davdroid/ui/signout/OpenIdEndSessionActivity.kt b/app/src/main/kotlin/at/bitfire/davdroid/ui/signout/OpenIdEndSessionActivity.kt index 5001315b4..9ea3766ec 100644 --- a/app/src/main/kotlin/at/bitfire/davdroid/ui/signout/OpenIdEndSessionActivity.kt +++ b/app/src/main/kotlin/at/bitfire/davdroid/ui/signout/OpenIdEndSessionActivity.kt @@ -67,15 +67,30 @@ class OpenIdEndSessionActivity : Activity() { ) { authorizationService = AuthorizationService(applicationContext) - val redirectUri = - IdentityProvider.retrieveByAccountType(this, accountType)?.logoutRedirectUri - - val intent = authorizationService!!.getEndSessionRequestIntent( - EndSessionRequest.Builder(configuration) - .setIdTokenHint(authState.idToken) - .setPostLogoutRedirectUri(redirectUri) - .build() - ) + val identityProvider = IdentityProvider.retrieveByAccountType(this, accountType) + val redirectUri = identityProvider?.logoutRedirectUri + val clientId = identityProvider?.clientId + + val endSessionRequestBuilder = EndSessionRequest.Builder(configuration) + + redirectUri?.let { + endSessionRequestBuilder.setPostLogoutRedirectUri(it) + } + + authState.idToken?.let { + endSessionRequestBuilder.setIdTokenHint(it) + } + + clientId?.let { + endSessionRequestBuilder.setAdditionalParameters( + mapOf("client_id" to it) + ) + } + + + val intent = authorizationService?.getEndSessionRequestIntent( + endSessionRequestBuilder.build() + ) ?: return startActivity(intent) } -- GitLab From 4f3d094f9c1d0b0fc5098aa1fc9a9ddf4ea0c5b9 Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Thu, 8 May 2025 13:22:19 +0600 Subject: [PATCH 2/2] fix: appIntro dependency not found appIntro dependency changes it's packageName, which causes dependency not found in repo issue. --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 86d38ef7d..03d288376 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -231,7 +231,7 @@ dependencies { // third-party libs implementation 'org.mnode.ical4j:ical4j:3.2.13' implementation 'com.jaredrummler:colorpicker:1.1.0' - implementation "com.github.AppIntro:AppIntro:${versions.appIntro}" + implementation "com.github.AppIntro:appintro:${versions.appIntro}" implementation("com.github.bitfireAT:dav4jvm:${versions.dav4jvm}") { exclude group: 'junit' } -- GitLab