huggingface / huggingface/chat-ui

OpenID does not work

Open
#896 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11k
Forks
1.7k
Avg merge
21h 24m
Merged PRs (30d)
56

Description

I set up the Openid verification service using keycloak( reference https://www.keycloak.org/getting-started/getting-started-docker). The local IP address of the verification service is a:b. Then I created a new realm namned "wtagent" and a new user named "test". Then I created a new client named "wtagent-client".
I built a big model conversation service using chat-ui. The local ip of the chat-ui service is c:d.
The two services are deployed on the same server using the Docker image.
I set the contents of the OPENID_CONFIG field in the .env.local file.
```
OPENID_CONFIG=`{
"PROVIDER_URL": "http://a:b/realms/wtagent",
"CLIENT_ID": "wtagent-client",
"CLIENT_SECRET": "xxxxx",
"SCOPES": "openid profile",
}`
```
The Access settings of wtagent-client are as follows:
```
Root URL: http://c:d/*
Valid redirect URIs: http://c:d/*
Valid post logout redirect URIs: http://c:d/*
Web origins: http://c:d
```
Then I logged in to http://c:d with chrome browser. Chat-ui prompts me to log in. I logged in with the username "test" and the password. I confirm that the account and password are correct. After entering the account password, the web-ui stays at the login screen. I checked the browser log with F12 and found an error: callback:
`1 Failed to load resource: the server responded with a status of 403 (Forbidden)`

I checked the backend log of keycloak, and the log content is as follows:

```
auth_method
openid-connect
auth_type
code
redirect_uri
http://c:d/login/callback
consent
no_consent_required
code_id
115fa596-c60f-4039-abf1-63f76513d4b2
username
test
```
According to the logs, there should be no problem with keycloak.

I don't know where the mistake is. How can this problem be solved?

All the above operations refer to the discussion: https://github.com/huggingface/chat-ui/discussions/644

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.