PHP 클래스 EOAuth2Service

상속: extends EAuthServiceBase, implements IAuthService
파일 보기 프로젝트 열기: nodge/yii-eauth 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$access_token current OAuth2 access token.
$client_id OAuth2 client id.
$client_secret OAuth2 client secret key.
$errorAccessDeniedCode Error code for access_denied response.
$errorDescriptionParam Error description key name in _GET options.
$errorParam Error key name in _GET options.
$providerOptions Provider options. Must contain the keys: authorize, access_token.
$scope OAuth scopes.

공개 메소드들

메소드 설명
authenticate ( ) : boolean Authenticate the user.
init ( $component, $options = [] )
makeSignedRequest ( string $url, array $options = [], boolean $parseJson = true ) : stdClass Returns the protected resource.

보호된 메소드들

메소드 설명
getAccessToken ( string $code ) : string Returns the OAuth2 access token.
getCodeUrl ( string $redirect_uri ) : string Returns the url to request to get OAuth2 code.
getSignedRequestFields ( ) : array Returns fields required for signed request.
getTokenUrl ( string $code ) : string Returns the url to request to get OAuth2 access token.
restoreAccessToken ( ) : boolean Restore access token from the session.
saveAccessToken ( string $token ) Save access token to the session.

메소드 상세

authenticate() 공개 메소드

Authenticate the user.
public authenticate ( ) : boolean
리턴 boolean whether user was successfuly authenticated.

getAccessToken() 보호된 메소드

Returns the OAuth2 access token.
protected getAccessToken ( string $code ) : string
$code string the OAuth2 code. See {@link getCodeUrl}.
리턴 string the token.

getCodeUrl() 보호된 메소드

Returns the url to request to get OAuth2 code.
protected getCodeUrl ( string $redirect_uri ) : string
$redirect_uri string url to redirect after user confirmation.
리턴 string url to request.

getSignedRequestFields() 보호된 메소드

By default returns array('access_token' => $this->access_token). Used in {@link makeSignedRequest}.
protected getSignedRequestFields ( ) : array
리턴 array

getTokenUrl() 보호된 메소드

Returns the url to request to get OAuth2 access token.
protected getTokenUrl ( string $code ) : string
$code string
리턴 string url to request.

init() 공개 메소드

public init ( $component, $options = [] )

makeSignedRequest() 공개 메소드

Returns the protected resource.
또한 보기: makeRequest
public makeSignedRequest ( string $url, array $options = [], boolean $parseJson = true ) : stdClass
$url string url to request.
$options array HTTP request options. Keys: query, data, referer.
$parseJson boolean Whether to parse response in json format.
리턴 stdClass the response.

restoreAccessToken() 보호된 메소드

Restore access token from the session.
protected restoreAccessToken ( ) : boolean
리턴 boolean whether the access token was successfuly restored.

saveAccessToken() 보호된 메소드

Save access token to the session.
protected saveAccessToken ( string $token )
$token string access token.

프로퍼티 상세

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

current OAuth2 access token.
protected $access_token

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

OAuth2 client id.
protected $client_id

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

OAuth2 client secret key.
protected $client_secret

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

Error code for access_denied response.
protected $errorAccessDeniedCode

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

Error description key name in _GET options.
protected $errorDescriptionParam

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

Error key name in _GET options.
protected $errorParam

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

Provider options. Must contain the keys: authorize, access_token.
protected $providerOptions

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

OAuth scopes.
protected $scope