-
Notifications
You must be signed in to change notification settings - Fork 75
Description
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!