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

chore: docs for accessing granted scope #2430

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,17 @@ $client->setHttpClient($httpClient);

Other Guzzle features such as [Handlers and Middleware](http://docs.guzzlephp.org/en/stable/handlers-and-middleware.html) offer even more control.

### Accessing Granted Scopes

If you're using OAuth2 3LO (e.g. you're a client requesting credentials from a
3rd party, such as in the [simple file upload example](examples/simple-file-upload.php),
you can see which scopes were granted by calling `getGrantedScope` on the OAuth2 object:

```php
// Comma-separated string of granted scopes if it exists, otherwise null.
$client->getOAuth2Service()->getGrantedScope();
```

### Service Specific Examples ###

YouTube: https://github.com/youtube/api-samples/tree/master/php
Expand Down