Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom providers #23

Open
katafrakt opened this issue Oct 3, 2020 · 3 comments
Open

Allow custom providers #23

katafrakt opened this issue Oct 3, 2020 · 3 comments

Comments

@katafrakt
Copy link
Contributor

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: katafrakt@78ab475 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.

@msa7
Copy link
Owner

msa7 commented Oct 4, 2020

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

@katafrakt
Copy link
Contributor Author

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.

@JadeKharats
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants