PHP Class Webiny\Component\OAuth2\Server\Facebook

Inheritance: extends Webiny\Component\OAuth2\AbstractServer, use trait Webiny\Component\StdLib\StdLibTrait
Show file Open project: Webiny/Framework

Public Methods

Method Description
getAccessTokenUrl ( ) : string Returns the path to the page where we request the access token.
getAuthorizeUrl ( ) : string Returns the path to OAuth2 authorize page.
getServerName ( ) : string Returns the server name.
processAuthResponse ( array $response ) : string This method is called when user is redirected to the redirect_uri from the authorization step.
processUserDetails ( array $result ) : OAuth2User This method is called automatically when the OAuth2 server returns a response containing user details.

Protected Methods

Method Description
getUserDetailsTargetData ( ) : array Returns an array [url, params].

Method Details

getAccessTokenUrl() public method

Returns the path to the page where we request the access token.
public getAccessTokenUrl ( ) : string
return string Url to access token page.

getAuthorizeUrl() public method

Returns the path to OAuth2 authorize page.
public getAuthorizeUrl ( ) : string
return string Url to OAuth2 authorize page.

getServerName() public method

Returns the server name.
public getServerName ( ) : string
return string

getUserDetailsTargetData() protected method

'url' - holds the destination url for accessing user details on the OAuth2 server. 'params' - an optional array of additional parameters that would be sent together with the request.
protected getUserDetailsTargetData ( ) : array
return array

processAuthResponse() public method

Here you should process the response from OAuth2 server and extract the access token if possible. If you cannot get the access token, throw an exception.
public processAuthResponse ( array $response ) : string
$response array Response from the OAuth2 server.
return string Access token.

processUserDetails() public method

The method should process the response an return and instance of OAuth2User.
public processUserDetails ( array $result ) : OAuth2User
$result array OAuth2 server response.
return Webiny\Component\OAuth2\OAuth2User