Skip to content

Commit 002efee

Browse files
author
Luca Degasperi
committed
Update README.md
1 parent 1ef0e74 commit 002efee

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,19 @@ Route::get('secure-route', array('before' => 'oauth:scope1,scope2|oauth-owner:cl
244244
}));
245245
```
246246

247+
## Getting the token owner ID and type
248+
249+
When accessing your API with an access token, you might want to know who's the owner of that token. The server makes it trivial.
250+
251+
```php
252+
$ownerId = ResourceServer::getOwnerId();
253+
```
254+
255+
When using the ```client_credentials``` grant type you might have users mixed with clients, to distinguish them use the following method
256+
257+
```php
258+
$ownerType = ResourceServer::getOwnerType();
259+
```
247260

248261
The aim of this package is to make working with oauth2 server stuff in Laravel a breeze. You can still access all the undelying power of the league/oauth2-server package via the ```ResourceServer``` and ```AuthorizationServer``` facades.
249262

0 commit comments

Comments
 (0)