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

Create common interface between providers #117

Open
eerison opened this issue Aug 25, 2022 · 0 comments
Open

Create common interface between providers #117

eerison opened this issue Aug 25, 2022 · 0 comments

Comments

@eerison
Copy link

eerison commented Aug 25, 2022

First step

My current suggestion started in this issue: thephpleague/oauth2-client#958

what I'm current struggle is have providers returning common interface with basic data like

firstName, lastName, email, and image

My suggestion is create different interfaces and the providers implements those interfaces for example.

  • ResourceOwnerFirstNameInterface
  • ResourceOwnerLastNameInterface
  • ResourceOwnerEmailInterface
  • ResourceOwnerImageUrlInterface

Then I can use a simple code from my side, expecting the correct fields for each provider, because for now we do not have a pattern for providers with basic info.

some providers use the email field with getEmail() and other with getUpn() like in this one: https://github.com/TheNetworg/oauth2-azure/blob/master/src/Provider/AzureResourceOwner.php#L61

Second step

As I didn't get any feedback in that repository, I was planning create a repository with those interfaces for example oauth2-contracts, and Open a PR here with adding this repository in your dependencies, and for the others libaries I'll do the same

Note: Note for all of them, just for want I'm using atm, But it can be implement easily for any other provider.

then I would like to know if does it make sense for you? if yes I would create that repository and Open a pull request with this feature!

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

1 participant