Ironically, I received a rogue 401 when posting this last time, so this may be light on details…
We had been successfully using /oauth/token to obtain access_tokens for our users using their auth_code after they login from our Java backend. After rotating our secret, we received a 401: Unauthorized in response, as expected. When we updated the properties file to change the secret, the 401 continued. We increased logging to confirm that we were sending the right secret and the shape of the request hadn’t changed, but the same 401 persists. Strangely, none of these attempts appear in the Logs on Auth0, so we are not sure what is happening. Is this some TTL delay that we’re waiting for? Has anyone run into this before?
I’ve tried to replicate your issue by rotating my Regular Web App client’s secret, getting a code from [GET /authorize] (Authentication API Explorer) and using that code in a POST /oauth/token with the new client secret. However, I successfully got an access token. Are you able to reproduce the issue if you call the management API directly (just to see if the problem is with the java code)?
To be clear, you did this with your account, right?
Our account was working with no problem right up until this day, so I don’t think there is a code issue. I am pretty sure the trouble is with some setting within the account. It is possible that the old secret didn’t even work this day, but we didn’t test that first.
It is just frustrating because we’ve had a ticket with no response for over a week and not having auth is an absolute work stoppage for us. We are working overtime now to locate alternatives and disentangle ourselves from all this.
Thanks for looking into it. I did some extra testing today to confirm everything and here is what is going on.
If we try to call it directly from our front end (javascript, jquery, angularJS, etc) we fail CORS (even though I added my domain to the Cross Origin field in the dashboard) on /oauth/token so I have to call it from my Java API.
When we make a curl request with the server the app is on I get the access token.
We had this process working with the Java API. I came in after the weekend and cycled the secret, then I started getting the 401. I really want to know if this 401 is coming out of Auth0 or if it never makes it to Auth0. The only message that comes back with connection is “Unauthorized”. I don’t know if it thinks the code is bad or the secret is bad or if my firewall could suddenly be to blame or if something is bugging out with the Tenant.
Sorry for such huge delay in response! We’re doing our best in providing you with best developer support experience out there, but sometimes our bandwidth is not enough comparing to the number of incoming questions.
Wanted to reach out to know if you still require further assistance?