I started w/ the tutorial available here:
I was able to get it to run fine and login. However I wanted to get the user info as well. I was going to use:
“https://abmi.auth0.com/api/v2/users/auth0|5a9daf64c437954dda64df5b” as this works fine in postman.
I added some code to “HomeController.java” for a simple test:
When I use the token from the “Principal” I get
**** Exception: 401 Unauthorized**
when I attempt to access the api.
However when I use the Token from “Auth0 Management API” on the website and just paste it in, I can use the API fine.
Result - status:200 getbody:
(Telling me its something with the token or my Auth0 config that is wrong).
I am trying to get user info using:
“https://” + appConfig.getDomain() + “/api/v2/users/” + principal.getName();
Any help about why my token isnt working would be appreciated.
The sample code tells me it is good:
Hello com.auth0.example.security.TokenAuthentication@62fcd873: Principal: auth0|5a9daf64c437954dda64df5b; Credentials: [PROTECTED]; Authenticated: true; Details: null; Not granted any authorities!
Thanks in advance