Oauth2_Generic issue

I click the ‘Oauth2 Generic’ button to authorize by my own oauth2 provider server and redirect with the code,it seems all good,but it appears this error and stuck with the sign in page.The server side has no error log output.What’s going on?

The error shows like this:Could not authenticate you from OAuth2Generic because “”.
There is the picture for the network activities:

Somebody help,thanks!

Did you ever find a solution?

FWIW, We had this particular issue which seems to be related to the user account. We deleted the user account and had the user login again using Oauth2 procedures which recreated the user and resolved the issue.

We still don’t understand the root cause, but hopefully the above can help someone else resolve a similar issue on their instance.