PHP 클래스 Happyr\LinkedIn\LinkedIn

When a new user arrives and want to authenticate here is whats happens: 1. You redirect him to whatever url getLoginUrl() returns. 2. The user logs in on www.linkedin.com and authorize your application. 3. The user returns to your site with a *code* in the the $_REQUEST. 4. You call isAuthenticated() or getAccessToken() 5. If we don't have an access token (only a *code*), getAccessToken() will call fetchNewAccessToken() 6. fetchNewAccessToken() gets the *code* from the $_REQUEST and calls getAccessTokenFromCode() 7. getAccessTokenFromCode() makes a request to www.linkedin.com and exchanges the *code* for an access token 8. When you have the access token you should store it in a database and/or query the API. 9. When you make a second request to the API we have the access token in memory, so we don't go through all these authentication steps again.
저자: Tobias Nyholm ([email protected])
상속: implements Happyr\LinkedIn\LinkedInInterface
파일 보기 프로젝트 열기: happyr/linkedin-api-client 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$accessToken Happyr\LinkedIn\AccessToken The OAuth access token received in exchange for a valid authorization code. null means the access token has yet to be determined.

공개 메소드들

메소드 설명
__construct ( string $appId, string $appSecret, string $format = 'json', string $responseDataType = 'array' ) Constructor.
api ( $method, $resource, array $options = [] )
clearStorage ( )
get ( string $resource, array $options = [] ) : mixed See docs for LinkedIn::api().
getAccessToken ( )
getError ( )
getLastResponse ( )
getLoginUrl ( $options = [] )
hasError ( )
isAuthenticated ( )
post ( string $resource, array $options = [] ) : mixed See docs for LinkedIn::api().
setAccessToken ( $accessToken )
setFormat ( $format )
setHttpClient ( Http\Client\HttpClient $client )
setHttpMessageFactory ( Http\Message\MessageFactory $factory )
setResponseDataType ( $responseDataType )
setStorage ( Happyr\LinkedIn\Storage\DataStorageInterface $storage )
setUrlGenerator ( Happyr\LinkedIn\Http\UrlGeneratorInterface $urlGenerator )

보호된 메소드들

메소드 설명
filterRequestOption ( array &$options ) : string Modify and filter the request options. Make sure we use the correct query parameters and headers.
getAuthenticator ( ) : Authenticator
getFormat ( ) : string Get the default format to use when sending requests.
getRequestManager ( ) : RequestManager
getResponseDataType ( ) : string Get the default data type to be returned as a response.
getUrlGenerator ( ) : Happyr\LinkedIn\Http\UrlGeneratorInterface

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( string $appId, string $appSecret, string $format = 'json', string $responseDataType = 'array' )
$appId string
$appSecret string
$format string 'json', 'xml'
$responseDataType string 'array', 'string', 'simple_xml' 'psr7', 'stream'

api() 공개 메소드

public api ( $method, $resource, array $options = [] )
$options array

clearStorage() 공개 메소드

public clearStorage ( )

filterRequestOption() 보호된 메소드

Modify and filter the request options. Make sure we use the correct query parameters and headers.
protected filterRequestOption ( array &$options ) : string
$options array
리턴 string the request format to use

get() 공개 메소드

See docs for LinkedIn::api().
public get ( string $resource, array $options = [] ) : mixed
$resource string
$options array
리턴 mixed

getAccessToken() 공개 메소드

public getAccessToken ( )

getAuthenticator() 보호된 메소드

protected getAuthenticator ( ) : Authenticator
리턴 Authenticator

getError() 공개 메소드

public getError ( )

getFormat() 보호된 메소드

Get the default format to use when sending requests.
protected getFormat ( ) : string
리턴 string

getLastResponse() 공개 메소드

public getLastResponse ( )

getLoginUrl() 공개 메소드

public getLoginUrl ( $options = [] )

getRequestManager() 보호된 메소드

protected getRequestManager ( ) : RequestManager
리턴 Happyr\LinkedIn\Http\RequestManager

getResponseDataType() 보호된 메소드

Get the default data type to be returned as a response.
protected getResponseDataType ( ) : string
리턴 string

getUrlGenerator() 보호된 메소드

protected getUrlGenerator ( ) : Happyr\LinkedIn\Http\UrlGeneratorInterface
리턴 Happyr\LinkedIn\Http\UrlGeneratorInterface

hasError() 공개 메소드

public hasError ( )

isAuthenticated() 공개 메소드

public isAuthenticated ( )

post() 공개 메소드

See docs for LinkedIn::api().
public post ( string $resource, array $options = [] ) : mixed
$resource string
$options array
리턴 mixed

setAccessToken() 공개 메소드

public setAccessToken ( $accessToken )

setFormat() 공개 메소드

public setFormat ( $format )

setHttpClient() 공개 메소드

public setHttpClient ( Http\Client\HttpClient $client )
$client Http\Client\HttpClient

setHttpMessageFactory() 공개 메소드

public setHttpMessageFactory ( Http\Message\MessageFactory $factory )
$factory Http\Message\MessageFactory

setResponseDataType() 공개 메소드

public setResponseDataType ( $responseDataType )

setStorage() 공개 메소드

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

setUrlGenerator() 공개 메소드

public setUrlGenerator ( Happyr\LinkedIn\Http\UrlGeneratorInterface $urlGenerator )
$urlGenerator Happyr\LinkedIn\Http\UrlGeneratorInterface

프로퍼티 상세

$accessToken 보호되어 있는 프로퍼티

The OAuth access token received in exchange for a valid authorization code. null means the access token has yet to be determined.
protected AccessToken,Happyr\LinkedIn $accessToken
리턴 Happyr\LinkedIn\AccessToken