multi_auth
multi_auth copied to clipboard
Allow custom providers
Some time ago I forked multi_auth, wanting to add Spotify support. But then I realized that maybe it's better to just allow developer to add their own provider, without the need to fork the project.
The outline commit for that is here: https://github.com/katafrakt/multi_auth/commit/78ab47533cdf9d50ead4f3f52afcb8e6695a94de Of course, this still requires testing and documentation, at least. I can do that and prepare a pull request, but since it's a new feature, I wanted to discuss it first.
I like it, hope compiler will embed only used providers. What about syntax like this:
MultiAuth.config(MultiAuth::Facebook, ENV['ID'], ENV['SECRET'])
And for backward compatibility this one
MultiAuth.config("facebook", ENV['ID'], ENV['SECRET'])
What about add Spotify
to this repo too? I think compiler will be smart to include Spotify only when used
I really like your API suggestions! Will do it like that. I hope I'll be able to work on that next week.
And sure, I can add Spotify integration too.
Hi,
I also asked myself the question on my side and I thought about this kind of config file
oauth:
url: api.oauth_provider.com"
key: 123
secret: 456
authorize_uri: "/oauth/authorize"
token_uri: "/oauth/token"
user_field:
provider: "custom"
uid: id
name: name
email: email
nickname: username
first_name: nil
last_name: nil
location: location
description: bio
image: image_url
phone: nil
url:
web_url: web_url