Failed exchange after post login action (form). auth0 logs show null clientID

Hello,

I’ve had a post login action that renders an onboarding form and its been working for months. Suddently today, I’m getting an “Unauthorized” error log, Type=“Failed exchange”.
The error shows up just as the user finishes posting the form.

In the error log, I see there is a null client ID. Not sure how this could happen, and I’ve changed nothing in auth0 lately.

Event data:

{
“audience”: “removed”,
“client_id”: null,
“client_name”: null,
“connection_id”: “”,
“date”: “2024-07-18T16:23:45.544Z”,
“description”: “Unauthorized”,
“hostname”: “removed”,
“ip”: “54.245.16.146”,
“scope”: null,
“type”: “feccft”,
“user_agent”: “Other 0.0.0 / Other 0.0.0”,
“user_id”: “”,
“user_name”: “”,
“log_id”: “90020240718162345629138000000000000001223372052626943043”,
“tenant_name”: “removed”,
“_id”: “90020240718162345629138000000000000001223372052626943043”,
“isMobile”: false,
“id”: “90020240718162345629138000000000000001223372052626943043”
}

Inside the Forms in the auth0 client, I can see the form execution has errors starting today.

Under execution, I see this error:

{
“code”: “ERR_ACTION_EXECUTION_ERROR”,
“message”: “Invalid OAuth credentials, please review the connection”
}

Under “Input”, I can see a bunch of metadata. I do see the correct “client” and “tenant” objects, including the correct client ID. So its interesting this form fails, with the input data having the correct client ID, but the auth0 log shows a null client id.

EDIT: if I comment out rendering of the form, everything works OK and I can login properly into the application. So I think there is a new bug in forms, but I could be wrong.

EDIT: Fixed. Somehow access to the management api was reset. Once I enabled access and scopes, its fixed. User error. Leaving this here for others.

Hello, I was wrong that this issue was fixed. It still persists.

I see the following error in the flow execution logs:

{
“code”: “ERR_ACTION_EXECUTION_ERROR”,
“message”: “Invalid OAuth credentials, please review the connection”
}

Under the Auth0 Management API, in Machine to Machine Applications I have granted my application the following scopes: is there something missing? The form sets some user and application metadata.

  • read:users_app_metadata
  • update:users_app_metadata
  • create:users_app_metadata

Any further advice appreciated!

1 Like

Hey there @michael33 !

Interesting - Sorry to hear this is still an issue!

Have you reviewed the vault connection for the M2M app you’ve selected to use in the Form? It might be worth deleting the connection and re-creating using the M2M you’ve used previously.

Thanks! I tried deleting and re-adding the Vault connection.
I’m copying the three fields directly from the Application->Settings field so I am sure they are correct.

Error details:

In input, I see various hidden fields, like this:

“context”: {
“user”: {
“email”: “███”,
“email_verified”: “███”,

And in the error section, I’m getting:

{
“code”: “ERR_ACTION_EXECUTION_ERROR”,
“message”: “Cannot find connection [ac_bffVmvwjW9vEhEhEfEx68C]”,
“details”: {
“connectionId”: “ac_bffVmvwjW9vEhEhEfEx68C”
}
}

Is there some way I can look up this connectionId in the console to debug this?

1 Like

Any insights? I don’t know how to debug this, it seems like it shoudl be working.

Hey @michael33 sorry for the delayed response here - Do you see that ID (ac_bffVmvwjW9vEhEhEfEx68C) in your vault connections? Which tenant are you working in? I did a quick search on your dev tenant and did not see that particular ID.

@tyf Progress, but still no go. Thanks for your suggestion. I went back and realized my flow’s vault connection had been reset, and I updated it.

Now the form submission actually finishes instead of erroring out… it at least continues to the login process.

But the meta-data I’m trying to update with the form isn’t getting set. In the Flow executions, the status is now “Success” - but I notice there is a 403 error. I’m not sure why the 403 error is being generated.

Under the Auth0 Management API in my console, under M2M Applications my application is turned on. The scopes have create, read and update:user_app_metadata checked off - so I think the permissions are correct?

I think I’m close, hopefully can get over the finish line soon.