在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):mastodon/omniauth-mastodon开源软件地址(OpenSource Url):https://github.com/mastodon/omniauth-mastodon开源编程语言(OpenSource Language):Ruby 100.0%开源软件介绍(OpenSource Introduction):OmniAuth::MastodonAuthentication 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
ConfigurationExample: Rails.application.config.middleware.use OmniAuth::Builder do
provider :mastodon, scope: 'read write follow', credentials: lambda { |domain, callback_url|
Rails.logger.info "Requested credentials for #{domain} with callback URL #{callback_url}"
existing = MastodonClient.find_by(domain: domain)
return [existing.client_id, existing.client_secret] unless existing.nil?
client = Mastodon::REST::Client.new(base_url: "https://#{domain}")
app = client.create_app('OmniAuth Test Harness', callback_url)
MastodonClient.create!(domain: domain, client_id: app.client_id, client_secret: app.client_secret)
[app.client_id, app.client_secret]
}
end The only configuration key you need to set is a lambda for |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论