Package

com.amarjanica.discourse

util

Permalink

package util

Visibility
  1. Public
  2. All

Type Members

  1. trait HasParameters extends Product

    Permalink
  2. trait HasQueryParameters extends AnyRef

    Permalink
  3. class SSOProvider extends AnyRef

    Permalink

    Helper class for providing single sign on integration with Discourse.

    Helper class for providing single sign on integration with Discourse.

    How the SSO works:

    1. User clicks "Login" on your site while your site has sso enabled.

    2. User is redirected to the link you have provided in the Discourse SSO settings. Using SSOProvider, you verify the incoming SSO request(via the configured SSO secret), then you authenticate the user that is trying to log in(by letting them log in to your system or by using their existing session in your system).

    3. You get the user information for the authenticated user, and use SSOProvider to build a query string that will be sent back to discourse/session/sso_login

    For example:

    val ctx: SSOContext = ???
    val req: SSOUserRequest = ???
    val sso = new SSOProvider(ctx).generate(req)
    val discourseSite = "http://discourse.example.com"
    // use redirectUrl to authenticate to your discourseSite
    val redirectUrl = s"${discourseSite}/session/sso_login?sso=${sso.payload}&sig=${sso.signature}"
    See also

    Discourse for more information

  4. trait SerializableAsJson extends AnyRef

    Permalink

Value Members

  1. object Json

    Permalink

Ungrouped