Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat history dose not work with Google Authentication #247

Closed
tanvlt opened this issue Sep 14, 2023 · 2 comments
Closed

Chat history dose not work with Google Authentication #247

tanvlt opened this issue Sep 14, 2023 · 2 comments
Assignees

Comments

@tanvlt
Copy link

tanvlt commented Sep 14, 2023

I enabled Chat history and it works well with default authentication (Microsoft Provider). But when i change to use Google the error occurs.
Screenshot 2023-09-14 at 11 25 56 AM
When i check in browser debug, There is an 500 error with api /history/list.
And this is the app service console log.
image

@sarah-widder
Copy link
Contributor

Hi @tanvlt the chat history feature leverages the Microsoft Identity Provider to get the logged in user's user ID, which is used to store/retrieve/update entries in the CosmosDB for that user. You can see we fetch the user ID from the backend request header in this function: https://github.com/microsoft/sample-app-aoai-chatGPT/blob/main/backend/auth/auth_utils.py#L1

To use another authentication provider, you would need to modify this logic to get a unique user ID for the logged in user from that provider. Then that ID can be used when interacting with the CosmosDB.

Hope that helps!

@Brennan-Richards
Copy link

Brennan-Richards commented Nov 8, 2023

Hey, @sarah-widder, will this also apply to AAD B2C added as an OIDC auth provider? It seems like the request from AAD B2C should include the same headers used in the application code that you pointed to, yet I experience the same "...CosmosDB is not working..." message. Any advice you can provide on reconciling the chat history feature with AAD B2C would be greatly appreciated by our team and customers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants