Skip to content

feature: [ANDROSDK-2345] build logout url#2662

Open
andresmr wants to merge 1 commit into
developfrom
ANDROSDK-2345
Open

feature: [ANDROSDK-2345] build logout url#2662
andresmr wants to merge 1 commit into
developfrom
ANDROSDK-2345

Conversation

@andresmr

@andresmr andresmr commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Adds a logout URL builder to the OAuth2 handler so apps can unregister the device after an offline login setup. d2.userModule().oauth2Handler().buildLogoutUrl(serverUrl) generates a state, persists it, and delegates to the network handler to build $serverUrl/dhis-web-commons-security/logout.action?redirect_uri=$REDIRECT_URI&state=$state, so the logout redirect can be correlated with the request. Unit tests cover both OAuth2HandlerImpl and OAuth2NetworkHandlerImpl.

Related task: ANDROSDK-2345

@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown


override fun buildLogoutUrl(serverUrl: String, state: String): String {
return "$serverUrl/dhis-web-commons-security/logout.action" +
"?redirect_uri=${OAuth2Config.DEFAULT_REDIRECT_URI}" +

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OAuth2Config class has a redirectUri property. Should we take this in the first place and, if it doesn't exist, default to the default one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants