venveo / craft-oauthclient

A free to use OAuth 2.0 Client helper for Craft 3 developers
MIT License
9 stars 3 forks source link

Support for configuring the provider base URL #25

Closed kennethormandy closed 4 years ago

kennethormandy commented 4 years ago

This PR adds support for configuring the the base authorization URL via settings, for League OAuth providers that support overriding it, ex:

$provider = new \League\OAuth2\Client\Provider\GenericProvider([
    'urlAuthorize' => 'http://brentertainment.com/oauth2/lockdin/authorize',
]);

If the field is left blank, the default urlAuthorize setting is used, so the initial setup is the same as now. I’m using a provider where it’s necessary to change the base URL, and from my understanding of the same providers, it is possible to make them without a default authorization URL at all.

Screenshot 2019-12-17 22 21 33

Thanks for the great work on this plugin!

Mosnar commented 4 years ago

Thanks for contributing! This looks good, but we need a migration for existing installations. If you want to add one, go ahead - otherwise, I'll probably get around to it this weekend.

kennethormandy commented 4 years ago

Thanks! I’m not familiar with doing that, so if you don’t mind, that would be really helpful. If you don’t get a chance, I will give it a go.

kennethormandy commented 4 years ago

Sorry about that, requested the re-review a bit too quickly! I thought I had this figured out, and then I pushed the wrong file to the branch 😑

I think it’s good now: c0c655c + aa2402b

Let me know how this looks to you.

Mosnar commented 4 years ago

Thanks! I'm going to merge it in and do a more thorough test before making a release.