How to auto-login user in application web view

We are planning to integrate discourse into our desktop application, for users to discuss UI features. For this purpose, the user shall never need to log in “by hand”, but instead already be authenticated in the web view instance. We have our own SSO service, which could deliver a token or something similar.

How does the discourse authentication in a web browser work in general? I’m not a web developer, so I have not much knowledge about how authentication inside a web browser usually works, but as far as I know, there is usually a cookie to store login information. Is this also the case for discourse? If so, how could this be exploited, or how can the login be automated?

You want to read DiscourseConnect - Official Single-Sign-On for Discourse (sso).

By using that and flipping login required to enabled, as soon as the user opens your webview he will be redirected to a URL of your choosing to start the authentication flow. If you make that seamless the user will be magically logged on Discourse moments later.

1 Like