1
0
Fork 0
mirror of synced 2024-07-08 16:06:02 +12:00

feat: added stackoverflow reference

This commit is contained in:
Christy Jacob 2019-10-13 22:11:49 +04:00
parent 4ac8cd50b9
commit c251451957

View file

@ -5,15 +5,15 @@ namespace Auth\OAuth;
use Auth\OAuth; use Auth\OAuth;
// Reference Material // Reference Material
// https://developers.google.com/oauthplayground/ // https://api.stackexchange.com/docs/me
// https://developers.google.com/identity/protocols/OAuth2 // https://api.stackexchange.com/docs/authentication
// https://developers.google.com/identity/protocols/OAuth2WebServer
class Google extends OAuth class Stackoverflow extends OAuth
{ {
/** // /**
* @var string // * @var string
*/ // */
protected $version = 'v4'; // protected $version = 'v4';
/** /**
* @var array * @var array
*/ */
@ -24,7 +24,7 @@ class Google extends OAuth
*/ */
public function getName(): string public function getName(): string
{ {
return 'google'; return 'stackoverflow';
} }
/** /**
@ -32,12 +32,11 @@ class Google extends OAuth
*/ */
public function getLoginURL(): string public function getLoginURL(): string
{ {
return 'https://accounts.google.com/o/oauth2/v2/auth?'. return 'https://stackoverflow.com/oauth?'.
'client_id='.urlencode($this->appID). 'client_id='.urlencode($this->appID).
'&redirect_uri='.urlencode($this->callback). '&redirect_uri='.urlencode($this->callback).
'&scope=https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile'. '&scope=https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile'.
'&state='.urlencode(json_encode($this->state)). '&state='.urlencode(json_encode($this->state));
'&response_type=code';
} }
/** /**