What expectation should I have for how long a user can stay logged on before being prompted again?
I have implemented my own check in functions.php, integrating with the SSO plugin for WordPress. My logic seems pretty simple but I just noticed that a member who had a declined credit card (hence removing the user tag that my logic checks) was able to access my forum today. On further checking she last logged on a couple of days ago and, I guess, still seems to be. Her last logon date for WordPress is also a few days back.
Is it expected that her cached credentials should still be working. If so, is there any way to control the validity of the token and/or respond to a webhook to force a logout?
This is controlled by the Discourse maximum session age site setting. It sets the number of hours that users will remail logged into your site for. It defaults to 1440 hours (60 days.) You could try setting this to a lower value. If you set it too low it will seem like a bug to your users.
This makes sense. You can log users out manually by going to their Discourse Admin page and clicking the ‘Log Out’ button that you’ll see near the top-right of the page. Another option for controlling this would be to add some code to your WordPress site that logs users out of Discourse when a membership expires.
Much appreciated, Simon. While I think 60 days is a too long for my scenarios (these are paying members and so they have an expectation we’d check they are still valid members), I do agree that reducing it too much can be a pain.
The final suggestion (find a way to log them out of Discourse when membership ends) is what I will research. I had seen the manual logout option but looking to totally automate all of this, so that seems like the right path.
Hmm… the description of the site setting says (emphasis mine):
User will remain logged in for n hours since last visit
If I understand correctly, could remain logged in forever if they continue to visit the site periodically even after they lose their SSO credentials. For example, if the setting were set to 72 hours, as long as they continued to visit the site every day or two, they’d remain logged in. Am I interpreting that correctly?
So is the implication of this that if someone cancels my membership and I want to be sure they can’t access my forum I will need to forcefully log them off (manually or via an API call)?
감사합니다. 페이스북 그룹(구독을 취소한 멤버를 수동으로 삭제해야 하는 구조)에서 전환해 온 입장에서, Discourse를 사용해도 구독을 취소한 멤버가 포럼에 접근하지 못하도록 수동으로 처리해야 한다는 점은 아쉬운 부분입니다. 이로 인해 질문이 하나 생겼습니다.
사용자가 더 이상 유효한 계정을 보유하지 않는 경우, 즉 로그인할 수 없는 경우, 해당 사용자가 Discourse에서 강제로 로그아웃되도록 보장할 수 있는 비수동(자동) 방식이 있을까요? 아무리 창의적인 방법이든 괜찮습니다.
SSO 메커니즘이 유효한 계정이 아님을 인식하여 로그인을 차단하는 것은 논리적으로 타당해 보이지만, 사용자가 단순히 포럼에 정기적으로(타임아웃 시간보다 짧은 간격으로) 접근하는 경우, 제가 수동으로 로그아웃 처리할 때까지 원할 만큼 오래 포럼에 접근할 수 있는 상황이 됩니다.
결국 마지막 선택지로, 사용자가 구독을 취소할 때 Discourse API를 호출하여 로그아웃 처리하는 플러그인을 직접 작성하는 것이 될 수도 있겠네요.
여기에 어떤 아이디어든 환영합니다. 알 수 있듯이, 이 작업을 수동으로 처리하는 것을 정말로 피하고 싶습니다
네, 이 문제는 WordPress에서 처리해야 합니다. WordPress에서 사용자가 _삭제_되면 WP Discourse 플러그인이 해당 사용자를 Discourse에서 로그아웃시키는 것이 합리적이라고 생각하지만, 이것이 당신의 문제를 해결할지는 확신할 수 없습니다. 제 추측에 따르면, 사이트에서 회원 자격이 만료되면 해당 사용자가 WordPress 사이트에서 삭제되지 않습니다. 회원 자격이 만료될 때 사용자를 Discourse에서 로그아웃시키려면, 회원 플러그인이 회원 자격 만료 시 트리거하는 액션에 연결되는 코드를 사이트에 추가해야 할 것입니다.
다시 한번 감사드립니다, @simon. 말씀하신 내용이 타당하지만, 한 번 더 의견을 말씀드려도 될까요
여기에는 두 가지 요인이 작용하는 것 같습니다. 하나는 계정의 유효성(즉, 활성 회원인지 여부)이고, 다른 하나는 Discourse에서 토큰의 유효성입니다.
전자의 경우, 이 부분은 WordPress가 관리해야 한다는 데 전적으로 동의하며, 시간이 허락하는 대로 조사해 보겠습니다.
그러나 Discourse 측에서 활성/유효한 토큰에 대한 문제도 있습니다. 이것이 최우선 순위가 아닐 수 있다는 점은 이해하지만, “강제 로그인” 기간을 설정할 수 있는 옵션(기본값은 꺼짐)에 대해선 일리가 있다고 봅니다. 즉, 사용자가 최근 로그인했는지 여부와 무관하게 x일 후 사용자 로그인 토큰이 만료되도록 하는 방식입니다.
다시 말씀드리지만, 여기서는 단순히 아이디어를 정리해 보는 중이지만, 사용자가 유효한 계정을 보유하고 있든 아니든 관계없이 로그아웃을 강제하는 옵션이 가치가 있다고 생각합니다.