Giter Site home page Giter Site logo

Keycloack integration about backend HOT 4 CLOSED

seatsurfing avatar seatsurfing commented on August 18, 2024
Keycloack integration

from backend.

Comments (4)

fashberg avatar fashberg commented on August 18, 2024

Hi,
can seatsurfing-backend really access "http://localhost:8081/realms/bob/protocol/openid-connect/token"?

Looks on misconfigured keyclock, check https://keycloak.xxx.tld/auth/realms/bob/.well-known/openid-configuration
At "token_endpoint" you should read the tokenurl. That endpoint must be reachable for seatsurfing backend (container).

from backend.

lifetooeasy avatar lifetooeasy commented on August 18, 2024

@fashberg thank you for looking into it. Actually, the redirect to keycloack works fine and I am able to authenticate:

Screenshot from 2023-10-16 09-58-16

Doesn't mean the the token_url is reachable from the backend container?

seat surfing containers and keycloack are running in the same host with different ports.

For information, the configuration link is now (keycloack 22.0.4) at https://keycloak.xxx.tld/realms/bob/.well-known/openid-configuration and not at
https://keycloak.xxx.tld/auth/realms/bob/.well-known/openid-configuration --> no /auth/

Does it bring something if changing this line:

https://github.com/seatsurfing/backend/blob/72ff3fa9bd0aa5c032dfa29d488d6a4281971c5f/server/auth-router.go#L530C10-L530C10

[Update]

Modifying the previous line I now see a blank page, I believe the correct redirectUrl is missing somewhere.

from backend.

fashberg avatar fashberg commented on August 18, 2024

You've wrote "I am using docker compose to test seatsurfing".
Imho: seatsurfing runs in its own container and each container has its own localhost. Docker basics.

From seatsurfing container you have to be able to reach keycloak container.
OpenId requires users (browsers) and app-server (seatsurfing) to talk to openid server. Backend has to access the token.

from backend.

lifetooeasy avatar lifetooeasy commented on August 18, 2024

Same issue now backend and keycloack in different machines and different hostnames (not running on localhost) with token endpoint accessible from backend container.
Login successful, redirect -> blank page.

The url looks like this:

http://seatsurfing.xxx.tld/811fc34e-d32d-4c5b-80ef-aaf890d9992a/callback?state=c2013fc8-af6c-4533-8fe5-923cfe612dda&session_state=2039cb12-14c1-4efd-b8d8-429fb7077190&code=9cb63aed-0126-41e2-b451-d7a62bddcd86.2039cb12-14c1-4efd-b8d8-429fb7077190.8491b1c6-555b-4a07-b9df-d6294067d3c1

from backend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.