# Automatically login via SSO

**URL:** <https://meta.discourse.org/t/automatically-login-via-sso/126195>\
**Category:** SSO\
**Created:** [August 19, 2019, 4:46pm UTC](https://meta.discourse.org/t/automatically-login-via-sso/126195 "2019-08-19T16:46:08Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![phallguy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/phallguy/32/150760_2.png) [@phallguy](https://meta.discourse.org/u/phallguy)\
**Post date:** [August 19, 2019, 4:46pm UTC](https://meta.discourse.org/t/automatically-login-via-sso/126195/1 "2019-08-19T16:46:08Z")

</div>

I have SSO up and running and all works well. However I’d like to automatically log in my users when they visit our Discourse community if they are already logged in to our main website. In effect click the “Log In” button to initiate the SSO and return them back to Discourse where they were originally.

I’ve only just started looking over the login code but was hoping someone else might have some insight on how I can initiate the login from a custom theme component.

---

_[View the full topic](https://meta.discourse.org/t/automatically-login-via-sso/126195)._
