A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/lackstein/omniauth-discourse below:

lackstein/omniauth-discourse: An OmniAuth strategy to authenticate against a Discourse forum

Allows OmniAuth to authenticate against a Discourse forum.

On your Discourse forum, go into the Admin Settings, check "enable sso provider" and generate a strong secret for "sso secret".

In your Rails app:

Add the following line to your Gemfile:

Then add the following line to your OmniAuth initializer:

provider :discourse,
  sso_url: "https://forum.example.com/session/sso_provider",
  sso_secret: Rails.application.secrets.sso_secret

Make sure you set the URL to point to your forum, and the secret to the secret generated earlier.

That's it!

Information provided by Discourse

The following information about each user will be available in the OmniAuth authhash:

uid do
  user_info[:external_id]
end

info do
  {
    "name" => user_info[:name],
    "email" => user_info[:email],
    "nickname" => user_info[:username]
  }
end

extra do
  {
    "admin" => user_info[:admin] == "true",
    "moderator" => user_info[:moderator] == "true"
  }
end

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4