PHP Class DirkGroenen\Pinterest\Auth\PinterestOAuth

Datei anzeigen Open project: dirkgroenen/pinterest-api-php

Public Methods

Method Description
__construct ( string $client_id, string $client_secret, Request $request ) Construct
getLoginUrl ( string $redirect_uri, array $scopes = ["read_public"], $response_type = "code" ) : string Returns the login url
getOAuthToken ( string $code ) : DirkGroenen\Pinterest\Transport\Response Change the code for an access_token
getState ( ) : string Get the generated state
setOAuthToken ( string $access_token ) : void Set the access_token for further requests
setState ( string $state ) : void Set a state manually

Private Methods

Method Description
generateState ( ) : string Generates a random string and returns is

Method Details

__construct() public method

Construct
public __construct ( string $client_id, string $client_secret, Request $request )
$client_id string
$client_secret string
$request DirkGroenen\Pinterest\Transport\Request

getLoginUrl() public method

Returns the login url
public getLoginUrl ( string $redirect_uri, array $scopes = ["read_public"], $response_type = "code" ) : string
$redirect_uri string
$scopes array
return string

getOAuthToken() public method

Change the code for an access_token
public getOAuthToken ( string $code ) : DirkGroenen\Pinterest\Transport\Response
$code string
return DirkGroenen\Pinterest\Transport\Response

getState() public method

Get the generated state
public getState ( ) : string
return string

setOAuthToken() public method

Set the access_token for further requests
public setOAuthToken ( string $access_token ) : void
$access_token string
return void

setState() public method

Set a state manually
public setState ( string $state ) : void
$state string
return void