About OIDC solution

Hi Team:

I found this project GitHub - Haulmont/jmix-oidc.
It’s can be worked, but i have a problem, when i use CurrentAuthentication in rest controller will get the error: Authentication principal must be UserDetails

how do i fix this, Or it will be fixed when the official version is released?


Have you gone through that?:

jmix-odic REAMDE: The DefaultJmixOidcUser class implements the JmixOidcUser interface. User class must always implement this interface because Jmix applications require the UserDetails interface, and Spring Security works with OidcUser interface. JmixOidcUser does nothing except implement both these interfaces.

Because the error message hints that your user class is not implementing that interface. There’s an example on the README

Yes, I referenced this document, but my situation is using Rest Controller. As shown below:

I pass the API path (http://localhost:8080/authenticated/hello) with the Access Token, However getting the above error

Hi, jmix-oidc is under development now. You’re right. It turns out that in the case of accessing REST controllers, the authentication principal is not of the proper type. We’ll look into it.

1 Like