Skip to content

Commit

Permalink
Update README docs (for #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
oddevan committed Jul 3, 2022
1 parent 6e7dccf commit 2c3df3f
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2c3df3f

Please sign in to comment.