Skip to content

OIDC re-authentication not working in v1.1.0 #105

@baum314nk

Description

@baum314nk

I have a local setup of OpenCloud with authelia as external IDP and use OIDC for authentication.
With the latest v1.1.0, I can only login for the first time after installing the app/wiping the app cache.
After that, whenever the token expired and I need to re-do the OIDC flow, it opens my authelia webview, I click on "Authenticate" and then I get routed to the login page of the app again but this time the server URL is empty.
If I enter the URL and try again, I get the same result.

Looking at the logs, I can see that the app actually receives an authorization code but fails to retrieve a token because it apparently can't correctly construct the base URL:

D: 2026-03-04 13:09:55:092(LoginActivity.kt:127)onCreate called with intent data: oc://android.opencloud.eu?code=authelia_ac_oU4jDSL_wpKI6IFGmLCBWGT5zfaHGUfRBfZ0q81fw04.ovZ2TnhiEVne5qBJLWqGICIRKq6Mke4AxTWnhCCFCjw&iss=https%3A%2F%2Fauth.server.internal&scope=openid+offline_access+email+profile&state=bmtjdkiuhDBO82We7EK_, isTaskRoot: true
D: 2026-03-04 13:09:55:108(LoginActivity.kt:645)Authorization code received [authelia_ac_oU4jDSL_wpKI6IFGmLCBWGT5zfaHGUfRBfZ0q81fw04.ovZ2TnhiEVne5qBJLWqGICIRKq6Mke4AxTWnhCCFCjw]. Let's exchange it for access token
V: 2026-03-04 13:09:55:109(MainApp.kt:222)LoginActivity onStart() starting
V: 2026-03-04 13:09:55:109(MainApp.kt:229)LoginActivity onResume() starting
D: 2026-03-04 13:09:55:111(ClientManager.kt:80)Creating new client for path: . Old client path: https://cloud.server.internal, requiresNewClient: false
D: 2026-03-04 13:09:55:111(OpenCloudClient.java:91)#22Creating OpenCloudClient
E: 2026-03-04 13:09:55:112(TokenRequestRemoteOperation.kt:84)Exception while getting tokens
java.net.MalformedURLException: no protocol: /index.php/apps/oauth2/api/v1/token
	at java.net.URL.<init>(URL.java:601)
	at java.net.URL.<init>(URL.java:498)
	at java.net.URL.<init>(URL.java:447)
	at eu.opencloud.android.lib.resources.oauth.TokenRequestRemoteOperation.run(TokenRequestRemoteOperation.kt:55)
	at eu.opencloud.android.lib.common.operations.RemoteOperation.runOperation(RemoteOperation.java:264)
	at eu.opencloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:229)
	at eu.opencloud.android.lib.resources.oauth.services.implementation.OCOIDCService.performTokenRequest(OCOIDCService.kt:49)
	at eu.opencloud.android.data.oauth.datasources.implementation.OCRemoteOAuthDataSource$performTokenRequest$tokenResponse$1.invoke(OCRemoteOAuthDataSource.kt:60)
	at eu.opencloud.android.data.oauth.datasources.implementation.OCRemoteOAuthDataSource$performTokenRequest$tokenResponse$1.invoke(OCRemoteOAuthDataSource.kt:59)
	at eu.opencloud.android.data.RemoteOperationHandlerKt.executeRemoteOperation(RemoteOperationHandler.kt:80)
	at eu.opencloud.android.data.oauth.datasources.implementation.OCRemoteOAuthDataSource.performTokenRequest(OCRemoteOAuthDataSource.kt:59)
	at eu.opencloud.android.data.oauth.repository.OCOAuthRepository.performTokenRequest(OCOAuthRepository.kt:37)
	at eu.opencloud.android.domain.authentication.oauth.RequestTokenUseCase.run(RequestTokenUseCase.kt:30)
	at eu.opencloud.android.domain.authentication.oauth.RequestTokenUseCase.run(RequestTokenUseCase.kt:25)
	at eu.opencloud.android.domain.BaseUseCaseWithResult.invoke(BaseUseCaseWithResult.kt:30)
	at eu.opencloud.android.extensions.ViewModelExt$runUseCaseWithResult$1.invokeSuspend(ViewModelExt.kt:67)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

I saw that there were quite some changes to the OIDC implementation between v1.1.0 and 1.0.0 (which is working fine, so I downgraded for the moment) so I guess this is some regression?

opencloud.2026-03-04_13.09.44.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions