PHP Class Happyr\LinkedIn\Authenticator

Author: Tobias Nyholm ([email protected])
Inheritance: implements Happyr\LinkedIn\AuthenticatorInterface
显示文件 Open project: happyr/linkedin-api-client

Protected Properties

Property Type Description
$appId string The application ID.
$appSecret string The application secret.

Public Methods

Method Description
__construct ( Happyr\LinkedIn\Http\RequestManagerInterface $requestManager, string $appId, string $appSecret )
clearStorage ( )
fetchNewAccessToken ( Happyr\LinkedIn\Http\LinkedInUrlGeneratorInterface $urlGenerator )
getLoginUrl ( Happyr\LinkedIn\Http\LinkedInUrlGeneratorInterface $urlGenerator, $options = [] )
setStorage ( Happyr\LinkedIn\Storage\DataStorageInterface $storage )

Protected Methods

Method Description
establishCSRFTokenState ( ) Lays down a CSRF state token for this process.
getAccessTokenFromCode ( Happyr\LinkedIn\Http\LinkedInUrlGeneratorInterface $urlGenerator, string $code ) : Happyr\LinkedIn\AccessToken Retrieves an access token for the given authorization code (previously generated from www.linkedin.com on behalf of a specific user). The authorization code is sent to www.linkedin.com and a legitimate access token is generated provided the access token and the user for which it was generated all match, and the user is either logged in to LinkedIn or has granted an offline access permission.
getCode ( ) : string | null Get the authorization code from the query parameters, if it exists, and otherwise return null to signal no authorization code was discovered.
getRequestManager ( ) : RequestManager
getStorage ( ) : Happyr\LinkedIn\Storage\DataStorageInterface

Method Details

__construct() public method

public __construct ( Happyr\LinkedIn\Http\RequestManagerInterface $requestManager, string $appId, string $appSecret )
$requestManager Happyr\LinkedIn\Http\RequestManagerInterface
$appId string
$appSecret string

clearStorage() public method

public clearStorage ( )

establishCSRFTokenState() protected method

Lays down a CSRF state token for this process.
protected establishCSRFTokenState ( )

fetchNewAccessToken() public method

public fetchNewAccessToken ( Happyr\LinkedIn\Http\LinkedInUrlGeneratorInterface $urlGenerator )
$urlGenerator Happyr\LinkedIn\Http\LinkedInUrlGeneratorInterface

getAccessTokenFromCode() protected method

Retrieves an access token for the given authorization code (previously generated from www.linkedin.com on behalf of a specific user). The authorization code is sent to www.linkedin.com and a legitimate access token is generated provided the access token and the user for which it was generated all match, and the user is either logged in to LinkedIn or has granted an offline access permission.
protected getAccessTokenFromCode ( Happyr\LinkedIn\Http\LinkedInUrlGeneratorInterface $urlGenerator, string $code ) : Happyr\LinkedIn\AccessToken
$urlGenerator Happyr\LinkedIn\Http\LinkedInUrlGeneratorInterface
$code string An authorization code.
return Happyr\LinkedIn\AccessToken An access token exchanged for the authorization code.

getCode() protected method

Get the authorization code from the query parameters, if it exists, and otherwise return null to signal no authorization code was discovered.
protected getCode ( ) : string | null
return string | null The authorization code, or null if the authorization code not exists.

getLoginUrl() public method

public getLoginUrl ( Happyr\LinkedIn\Http\LinkedInUrlGeneratorInterface $urlGenerator, $options = [] )
$urlGenerator Happyr\LinkedIn\Http\LinkedInUrlGeneratorInterface

getRequestManager() protected method

protected getRequestManager ( ) : RequestManager
return Happyr\LinkedIn\Http\RequestManager

getStorage() protected method

protected getStorage ( ) : Happyr\LinkedIn\Storage\DataStorageInterface
return Happyr\LinkedIn\Storage\DataStorageInterface

setStorage() public method

public setStorage ( Happyr\LinkedIn\Storage\DataStorageInterface $storage )
$storage Happyr\LinkedIn\Storage\DataStorageInterface

Property Details

$appId protected_oe property

The application ID.
protected string $appId
return string

$appSecret protected_oe property

The application secret.
protected string $appSecret
return string