Chainlit / chainlit

Build Conversational AI in minutes ⚡️
https://docs.chainlit.io
Apache License 2.0
7.13k stars 935 forks source link

Azure AD Oauth Provider is reusing Authorization code #1241

Closed hmrc87 closed 2 months ago

hmrc87 commented 2 months ago

Describe the bug We are using the AD Azure Provider. For most users it is working, but for some users we get

"errorCode": 54005 with the message "Oauth2 Authorization code was already redeemed, please retry with a new valid code or use an existing refresh token.",

We compared the tokens but did not see a big difference. It is also not related to the users machine since we tested another account on the users Browser and it works there.

Any idea? To Reproduce

Expected behavior It should work for all users

hmrc87 commented 2 months ago

This can be closed. The problem was that our identity provider in azure is returning quite a big response which our nginx in the Kuberentes cluster could not handle. Increasing the proxy_buffer_size of nginx to 16k helped. I suppose this is not directly related to Chainlit.

However I strongly support @dokterbob initiative to NOT roll your own auth and instead use existing libraries