How to hook up JWT Single Sign On to Discourse

AI-generated summary

A user seeks to integrate JWT-based Single Sign-On (SSO) with Discourse for their Play 2.5 application, aiming to redirect users to their app for authentication and return a JWT token to Discourse. They found two JWT-related plugins but are unsure which to use. eviltrout recommends the official JWT Plugin, noting it’s production-tested, and points to a guide for plugin installation. Later, BalintH asks whether the JWT plugin is available for non-self-hosted Discourse instances, since it’s not listed under business plans. eviltrout clarifies that JWT support is not included in Discourse’s business tier and strongly advises using OpenID, OAuth2, or DiscourseConnect instead, asking if JWT is their only authentication option. The discussion highlights a gap for hosted Discourse users needing JWT SSO, with official support currently limited to self-hosted deployments.

We are investigating using Discourse as a forum section for our website. Our existing app is a Play 2.5 application with it’s own login setup and a JWT authenticator. Our goal is to implement some form of single-sign-on setup where users will be redirected (from Discourse) to our Play app to authenticate, the JWT token is created and sent back (via redirect) to Discourse for use in validating subsequent actions.

I found both GitHub - discourse/discourse-omniauth-jwt: An OmniAuth strategy that uses JSON Web Token for Single Sign-On · GitHub and GitHub - discourse/discourse-jwt: Discourse Auth support for JSON Web Tokens (JWT) · GitHub but am unsure if they will support what we are looking for or how to integrate them (I am very new to Discourse). Is there a similar alternative (with JWT) that I am unaware of?

The official JWT Plugin is what you want. We’ve deployed it in production and it works well for people.

If you’re unsure how to install a plugin, I suggest you check out @techAPJ’s excellent guide.

Привет! Мы пытаемся реализовать аналогичный процесс, как в оригинальном посте. Я изучил плагин JWT и руководство по его установке, и, похоже, там описывается только установка на самостоятельно размещённых экземплярах, а сам плагин не указан ни в одном из бизнес-планов. Поэтому мой вопрос: как возможно использовать плагин JWT с экземпляром, который не размещён самостоятельно?

К сожалению, в нашем тарифе Business поддержка JWT не включена, и мы настоятельно рекомендуем использовать OpenID, OAuth2 или DiscourseConnect. Это ваш единственный вариант аутентификации?