d3473r / jitsi-keycloak

Login to jitsi with keycloak https://github.com/d3473r/jitsi-keycloak/pkgs/container/jitsi-keycloak
https://github.com/d3473r/jitsi-keycloak
MIT License
54 stars 23 forks source link

did you configure CORS correctly? #78

Closed celevra closed 1 year ago

celevra commented 1 year ago

Hi,

i get an alert windows with the Question "Did you configure CORS correctrly" but if i take a look into the console i can't find cors errors, only one 401 error against the keycloak:

keycloak.mjs:776     POST https://login.xxx.xxx/realms/xxx/protocol/openid-connect/token 401 (Unauthorized)

any ideas?

d3473r commented 1 year ago

Hmm, maybe you have a typo in your realm or client-id. Can you attach a screenshot of the client settings in keycloak?

celevra commented 1 year ago
image
d3473r commented 1 year ago

Thanks :) You configured the client as a confidential client. But it should be configured as a public one, as this is a browser app which cannot hold secrets:

For comparison, my keycloak config looks like this:

{
  "realm": "realm",
  "auth-server-url": "https://iam.example.com/auth",
  "ssl-required": "external",
  "resource": "client",
  "public-client": true,
  "confidential-port": 0
}
Screenshot 2023-09-25 at 10 37 02
celevra commented 1 year ago

thank you, from there i came a step further but had curs issues that where strange to me (we have a dozen of clients in our keycloak that are not having cors issues). To keep it short: you showed me the simple idea: an app that authenticates via keycloak and then signs a jwt and redirects back. We had everything we needed in node so that we hacked a little script. thanks for you help and time