# How to auto-login user in application web view

**URL:** https://meta.discourse.org/t/how-to-auto-login-user-in-application-web-view/193879
**Category:** SSO
**Created:** [June 15, 2021, 10:44am UTC](https://meta.discourse.org/t/how-to-auto-login-user-in-application-web-view/193879 "2021-06-15T10:44:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![machinekoder](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/machinekoder/32/224214_2.png) [@machinekoder](https://meta.discourse.org/u/machinekoder)
#### Post date: [June 15, 2021, 10:44am UTC](https://meta.discourse.org/t/how-to-auto-login-user-in-application-web-view/193879/1 "2021-06-15T10:44:02Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [June 15, 2021, 1:44pm UTC](https://meta.discourse.org/t/how-to-auto-login-user-in-application-web-view/193879/2 "2021-06-15T13:44:49Z")

</div>

You want to read [DiscourseConnect - Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/discourseconnect-official-single-sign-on-for-discourse-sso/13045).

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.
