How to retrieve userId with reactive spring security?

I am following the quick start tutorial for Spring 5: https://auth0.com/docs/quickstart/backend/java-spring-security5/01-authorization

However I don’t know how to retrieve userId from Auth0.

Object p = ReactiveSecurityContextHolder.getContext()
        .map(SecurityContext::getAuthentication)
        .map(Authentication::getPrincipal).block();

The code above always return null.

Hey there!

Can I ask you to raise it as a GitHub issue in the sample repo so we can work on that with the sample maintainers? Make sure to share the link to it then with us. Thank you!

1 Like

Issue created: https://github.com/auth0-samples/auth0-spring-security5-api-sample/issues/7

1 Like

Perfect thanks! I’ll let sample maintainers in a few minutes!

1 Like

Hi Konrad. Is anyone working on this ticket? What’s the ETA for this?

There’s no public ETA on that. The team responsible for maintaining samples works on all those issue based on their issues backlog priorities so they’ll get to working on it as soon as they can.