Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 1007 Bytes

README.md

File metadata and controls

31 lines (23 loc) · 1007 Bytes

OmniAuth::Mastodon

Gem Version

Authentication strategy for federated Mastodon instances. This is just slightly more complicated than a traditional OAuth2 flow: We do not know the URL of the OAuth end-points in advance, nor can we be sure that we already have client credentials for that Mastodon instance.

Installation

gem 'omniauth-mastodon-st'

Configuration

Example:

MASTODON_OMNIUATH_SETUP = lambda do |env|
  env["omniauth.strategy"].options[:domain] = Settings::Authentication.mastodon_domain
  env["omniauth.strategy"].options[:client_id] = Settings::Authentication.mastodon_client
  env["omniauth.strategy"].options[:client_secret] = Settings::Authentication.mastodon_secret
  env["omniauth.strategy"].options[:scope] = "read"
end
Devise.setup do |config|
  config.omniauth :mastodon, setup: MASTODON_OMNIUATH_SETUP
end