Oauth browser path not found 404

we had a working oauth authentification flow between one of our app and dhis2
but it seem that after the redirection to

https://dhis2.domain/uaa/oauth/authorize/?client_id=orbf2&response_type=code

we get the tomcat error

# HTTP Status 404 – Not Found

---

**Type** Status Report

**Message** No static resource uaa/oauth/authorize.

**Description** The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

was there any changes in the oauth flow in 2.4x ? (here 2.42)
the documentation still mention that url : Introduction - DHIS2 Documentation

thank you

Hi @Stephan_Mestach

Thank you for your post. I guess the docs need updating because it’s mentioned in the release notes starting from version 2.42 “remove OAuth2 from settings app v42”, and it’s mentioned in the ‘deprecated features’ notes that “The old and deprecated OAuth support will be removed” (see table ‘Removed features’ row 4).

If you face any issue to start using the new supported OAuth 2.0 then please feel free to reply here.

Thanks!

Can you point me to the OAuth 2.0 ? I still end up with the wrong path/flow
(I’m using the web flow)

Hi Stéphan,

I’m sorry to inform that the documentation for 2.42 is very outdated.
We did a big change to the OAuth2 backend in 2.42 and it’s now served by the Spring Authorization server project.
The quickest way to get up to date, is probably to have a look at this test:

This test does a full e2e authorization code flow test.
If you have any questions you can contact me directly also.
It’s on the agenda to get the documentation updated soon.

Hello @netroms and @Gassim I am a little confused by the links:

says: remove OAuth2

says: The old and deprecated OAuth support will be removed
and just up above: Oauth browser path not found 404 - #2 by Gassim
says: “the new supported OAuth 2.0”

So I wanted to ask, is DHIS 2 supporting OAuth 2.0 going forward or not?
And how does this affect OIDC with Azure/Google/Okta?

Hi Timothy,

I know this is a bit confusing, especially since the documentation is not updated.
To make it clearer:

  • The old deprecated OAuth2 code spring-security-oauth2 was EOL in 2022. This code module was responsible for making DHIS2 an “authorization server”, before 2.42.
  • In 2.42, we removed the deprecated spring-security-oauth2 module, and replaced it it with the new https://spring.io/projects/spring-authorization-server

DHIS2 still has full OAuth2/OIDC client support, typically responsible for the feature “login with Google/Azure/Keycloak” etc.
It also has “authorization server” support, being able to create access/refresh token pairs. We currently support the authorization code flow.
The latest Android app, can now login with OAuth2 to a DHIS2 (2.43+) server, configured as an authorization server. Backport to 2.42 is in the backlog.

Best regards,
Morten

Thanks Morten! i’m tracking now. So if DHIS 2 is they authorization/authentication provider, 2.42 may cause issues for some specific android app use cases. But DHIS 2 as the authentication client, nothing has changed!