Git Product home page Git Product logo

Comments (8)

gberaudo avatar gberaudo commented on August 29, 2024

In order to be authenticated on the forum, some cookies must be set by the
forum into user's browser.

Try 1: handle setting cookies in API backend:

  • handle forum login entirely inside the API backend;
  • Proxy back the Set-Cookie to the UI.
    In order to handle subdomains (api, ui and forum), the domain property need
    to be set on the cookie, making it shared between all subdomains.
    Strangely, the cookies where received by the browser but where not sent on subsequent requests. It also requires the 'withCredentials' option to be set on the angular service and the API backend modified.

Try2: handle setting cookies in an iframe:

  • handle generation of the redirect URL in the API backend;
  • Use a hidden iframe with the redirect URL (cookies are directly set by the forum).
    This solution works almost correctly. The main drawback is an error printed in the console which could probably be workarounded.

I am going to prepare a PR based on try2.

from v6_forum.

asaunier avatar asaunier commented on August 29, 2024

Proxy back the Set-Cookie to the UI. In order to handle subdomains (api, ui and forum), the domain property need to be set on the cookie, making it shared between all subdomains.

Having domain-wide cookies might be a problem since other instances of the UI/API/forum will probably be set for test/dev purposes on the same domain (and would share the cookies then...).

from v6_forum.

asaunier avatar asaunier commented on August 29, 2024

@gberaudo can we update the todo list at the beginning of this issue?

What about the logout in Discourse pages? We need that the user is then also logged out from the UI.
See c2corg/v6_ui#203 (comment)

from v6_forum.

gberaudo avatar gberaudo commented on August 29, 2024

See https://meta.discourse.org/t/discourse-sso-logout/28509

from v6_forum.

asaunier avatar asaunier commented on August 29, 2024

Could you summarize? I don't have the patience to read the thead :P

from v6_forum.

gberaudo avatar gberaudo commented on August 29, 2024

There exists a redirect URL setting for logout. We can use it to redirect to the UI, handle the UI logout and redirect back to the forum.

from v6_forum.

gberaudo avatar gberaudo commented on August 29, 2024

The alternative is to hide the forum login/logout buttons with CSS.

from v6_forum.

asaunier avatar asaunier commented on August 29, 2024

That's not very intuitive to have to go to another page (UI) to be able to log out.

from v6_forum.

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.