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

Use ArrayAccessor in GenericResourceOwner #788

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
1 participant
@AndreiIgna
Copy link

commented May 31, 2019

Allow the resourceOwnerId to be specified in more formats, like user.id.
This would enable the GenericProvider to be used with more OAuth APIs.

Slack, for example, returns the user info in a nested array https://api.slack.com/methods/users.identity#response

By accepting this PR, the Slack OAuth and others can be used with the GenericProvider.

AndreiIgna added some commits May 31, 2019

Use ArrayAccessor in GenericResourceOwner
Allow the `resourceOwnerId` to be specified in more formats, like `user.id`
@AndreiIgna

This comment has been minimized.

Copy link
Author

commented May 31, 2019

Second commit adds GenericResourceOwner::getAttribute() helper method, which makes it easier to access user data.

// at the moment
$userData = $resourceOwner->toArray();
$userField = $userData['field'];
$userField2 = $userData['group']['field'];

// with getAttribute() method
$userField = $resourceOwner->getAttribute('field');
$userField2 = $resourceOwner->getAttribute('group.field');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.