简体   繁体   中英

DiscourseConnect auto login when visiting forum

I've set up my first Discourse instance, wrote a custom endpoint on my ASP.NET 5 web app, and enabled DiscourseConnect.
Everything works fine - when the user clicks the Log In button he gets logged in (if he is logged in into my website)
The forum will be available only to my website users, so I'd like to automatically log them in when they visit the forum (they are redirected to my login/register form via DiscourseConnect)

here is the website structure:

  • main website: example.com
  • identity server: identity.example.com (used for SSO)
  • forum: forum.example.com

I couldn't find anything on the Discourse Meta, so I'm asking her:
How to do automatic login when the user visits forum.example.com.

I'm aware I can create a link on my website that redirects to sso ( https://example.com/session/sso ), but this will work if the user starts from my website (by clicking a link in the menu). If he bookmarks the forum and opens it via that bookmark (or directly by typing the address) that automatic login won't happen.

如果您只允许一种登录方式,只需启用login required站点设置,访问者将自动跳转到您的 ASP 应用程序。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM