# Automatic account creation and login when login\_required is false

**URL:** https://meta.discourse.org/t/automatic-account-creation-and-login-when-login-required-is-false/352796
**Category:** Support
**Tags:** sso
**Created:** [February 17, 2025, 11:38pm UTC](https://meta.discourse.org/t/automatic-account-creation-and-login-when-login-required-is-false/352796 "2025-02-17T23:38:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![SkhemaDeveloper](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/skhemadeveloper/32/489145_2.png) [@SkhemaDeveloper](https://meta.discourse.org/u/SkhemaDeveloper)
#### Post date: [February 17, 2025, 11:38pm UTC](https://meta.discourse.org/t/automatic-account-creation-and-login-when-login-required-is-false/352796/1 "2025-02-17T23:38:07Z")

</div>

Hi folks,

I previously had configured an SSO flow where login\_required was set to true and it worked nicely. Users within my application follow a link to the community and their account is automatically created and immediately logged in (a disclaimer notifies them of this process).

Now I want to reduce this requirement, and expose the site content to allow for anonymous access, however, the flow of a **‘logged in user in my application’** should still be the same. i.e. if they come from within my application their account should be automatically created and immediately logged in. They shouldn’t be treated as anonymous.

![The image displays a login requirement notice that asks users to authenticate to read content and disallow anonymous access. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/a/7/e/a7e7b2b37f07b08b925779b7645982f007bc7dc6.png)

I’ve tried toggling site settings, but auth immediately only takes effect when login\_required

![image](https://global.discourse-cdn.com/meta/original/4X/b/0/f/b0f5fe2b7de890d2ff0c8cdc0b73eecf901bb4c2.png)

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/7/0/e70737226ead0673ddbc66e9d0ac61a2c77eacf9.png)

How can I I achieve this?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [February 18, 2025, 10:39am UTC](https://meta.discourse.org/t/automatic-account-creation-and-login-when-login-required-is-false/352796/2 "2025-02-18T10:39:39Z")

</div>

You can achieve that by linking to `https://community.example.com/session/sso` for authenticated users in your application. That will trigger the login / account creation flow. You could also add the parameter `?return_path` to link to a specific page.

For unauthenticated users you should still link to `https://community.example.com`.

---

<div class="post-metadata">

### Author: ![SkhemaDeveloper](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/skhemadeveloper/32/489145_2.png) [@SkhemaDeveloper](https://meta.discourse.org/u/SkhemaDeveloper)
#### Post date: [February 18, 2025, 10:15pm UTC](https://meta.discourse.org/t/automatic-account-creation-and-login-when-login-required-is-false/352796/3 "2025-02-18T22:15:56Z")

</div>

Excellent. Thank you!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [March 20, 2025, 10:15pm UTC](https://meta.discourse.org/t/automatic-account-creation-and-login-when-login-required-is-false/352796/4 "2025-03-20T22:15:58Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
