Skip to content

Instantly share code, notes, and snippets.

@jnbdz
Created November 24, 2013 08:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnbdz/7624654 to your computer and use it in GitHub Desktop.
Save jnbdz/7624654 to your computer and use it in GitHub Desktop.
League OAuth2 - DropBox
<?php
namespace League\OAuth2\Client\Provider;
use League\OAuth2\Client\Token\AccessToken;
class DropBox extends IdentityProvider
{
public function urlAuthorize()
{
return 'https://www.dropbox.com/1/oauth2/authorize';
}
public function urlAccessToken()
{
return 'https://api.dropbox.com/1/oauth2/token';
}
public function urlUserDetails(AccessToken $token)
{
return 'https://api.dropbox.com/1/account/info?access_token='.$token;
}
public function userDetails($response, AccessToken $token)
{
$user = new User;
$user->uid = $response->uid;
$user->name = $response->display_name;
$user->email = $response->email;
return $user;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment