FriendsOfFlarum / passport

The Laravel passport compatible oauth extension for your Flarum forum.
https://discuss.flarum.org/d/5203
MIT License
29 stars 11 forks source link

use sub instead of id #40

Closed nched closed 10 months ago

nched commented 10 months ago

Feature Request

The standard in verifying user information is sub instead of id. Many oauth implementations will deliver the user id as sub. https://www.oauth.com/oauth2-servers/signing-in-with-google/verifying-the-user-info/

It would be useful to change id to sub

Describe the solution you'd like public function getId() { return $this->getValueByKey( $this->response, Arr::get(static::$fields, 'sub', 'sub') ); }

luceos commented 10 months ago

This extension was primarily created to work with the Laravel Passport package. If you really need it to be more flexible either sent in a PR that adds this without losing the current logic, commission a developer to do it, or fork it so that you can use it privately with the modification.

As you mention google, you might also be interested in the FriendsOfFlarum OAuth extension, it actually works with Google: https://extiverse.com/extension/fof/oauth

nched commented 10 months ago

thank you Luceos for the info. I was looking for a standard oauth plugin and passport is far more useable than the normal oauht extension, because it allows to set client-id, secret, scope, etc. The ouath extension is limited to the standard oauth providers - which I don't use. I guess I write a patch that I can apply via composer.

luceos commented 10 months ago

@imorland this can be closed