diff --git a/README.md b/README.md index be949df..e399cc5 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,35 @@ $provider = new Smolblog\OAuth2\Client\Provider\Twitter([ if (!isset($_GET['code'])) { unset($_SESSION['oauth2state']); unset($_SESSION['oauth2verifier']); + + // Optional: The default scopes are ‘tweet.read’, ‘users.read’, + // and ‘offline.access’. You can change them like this: + $options = [ + ‘scope’ => [ + ‘tweet.read’, + ‘tweet.write’, + ‘tweet.moderate.write’, + ‘users.read’, + ‘follows.read’, + ‘follows.write’, + ‘offline.access’, + ‘space.read’, + ‘mute.read’, + ‘mute.write’, + ‘like.read’, + ‘like.write’, + ‘list.read’, + ‘list.write’, + ‘block.read’, + ‘block.write’, + ‘bookmark.read’, + ‘bookmark.write’, + ], + ]; + // If we don't have an authorization code then get one - $authUrl = $provider->getAuthorizationUrl(); + $authUrl = $provider->getAuthorizationUrl($options); $_SESSION['oauth2state'] = $provider->getState(); // We also need to store the PKCE Verification code so we can send it with