PHP 클래스 OpenIDConnectClient

파일 보기 프로젝트 열기: jumbojett/openid-connect-php 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( $provider_url = null, $client_id = null, $client_secret = null )
addAuthParam ( $param )
addScope ( $scope )
authenticate ( ) : boolean
canVerifySignatures ( ) : boolean
getAccessToken ( ) : string
getAccessTokenHeader ( ) : array
getAccessTokenPayload ( ) : array
getClientID ( ) : string
getClientName ( ) : mixed
getClientSecret ( ) : string
getIdToken ( ) : string
getIdTokenHeader ( ) : array
getIdTokenPayload ( ) : array
getProviderURL ( ) : string
getRedirectURL ( ) : string Gets the URL of the current page we are on, encodes, and returns it
getRefreshToken ( ) : string
getTokenResponse ( ) : array
providerConfigParam ( $array ) Use this to alter a provider's endpoints and other attributes
redirect ( $url )
refreshToken ( $refresh_token ) : mixed Requests Access token with refresh token
register ( ) Dynamic registration
requestUserInfo ( $attribute = null ) : mixed
setCertPath ( $certPath )
setClientID ( $clientID )
setClientName ( $clientName )
setClientSecret ( $clientSecret )
setHttpProxy ( $httpProxy )
setProviderURL ( $provider_url )
setRedirectURL ( $url )
setResponseTypes ( $response_types )

보호된 메소드들

메소드 설명
fetchURL ( $url, null $post_body = null, array() $headers = [] ) : mixed
generateRandString ( ) : string Used for arbitrary value generation for nonces and state
getNonce ( ) : string Get stored nonce
getState ( ) : string Get stored state
setNonce ( string $nonce ) : string Stores nonce
setState ( string $state ) : string Stores $state
unsetNonce ( ) : void Cleanup nonce
unsetState ( ) : void Cleanup state
urlEncode ( string $str ) : string

비공개 메소드들

메소드 설명
decodeJWT ( $jwt, integer $section ) : object
getProviderConfigValue ( $param, $default = null ) : string Get's anything that we need configuration wise including endpoints, and other values
get_key_for_header ( array $keys, array $header ) : object
requestAuthorization ( ) : void Start Here
requestTokens ( $code ) : mixed Requests ID and Access tokens
verifyJWTclaims ( object $claims, $accessToken = null ) : boolean
verifyJWTsignature ( $jwt ) : boolean
verifyRSAJWTsignature ( string $hashtype, object $key, $payload, $signature ) : boolean

메소드 상세

__construct() 공개 메소드

public __construct ( $provider_url = null, $client_id = null, $client_secret = null )
$provider_url string optional
$client_id string optional
$client_secret string optional

addAuthParam() 공개 메소드

public addAuthParam ( $param )
$param - example: prompt=login

addScope() 공개 메소드

public addScope ( $scope )
$scope - example: openid, given_name, etc...

authenticate() 공개 메소드

public authenticate ( ) : boolean
리턴 boolean

canVerifySignatures() 공개 메소드

public canVerifySignatures ( ) : boolean
리턴 boolean

fetchURL() 보호된 메소드

protected fetchURL ( $url, null $post_body = null, array() $headers = [] ) : mixed
$url
$post_body null string If this is set the post type will be POST
$headers array()
리턴 mixed

generateRandString() 보호된 메소드

Used for arbitrary value generation for nonces and state
protected generateRandString ( ) : string
리턴 string

getAccessToken() 공개 메소드

public getAccessToken ( ) : string
리턴 string

getAccessTokenHeader() 공개 메소드

public getAccessTokenHeader ( ) : array
리턴 array

getAccessTokenPayload() 공개 메소드

public getAccessTokenPayload ( ) : array
리턴 array

getClientID() 공개 메소드

public getClientID ( ) : string
리턴 string

getClientName() 공개 메소드

public getClientName ( ) : mixed
리턴 mixed

getClientSecret() 공개 메소드

public getClientSecret ( ) : string
리턴 string

getIdToken() 공개 메소드

public getIdToken ( ) : string
리턴 string

getIdTokenHeader() 공개 메소드

public getIdTokenHeader ( ) : array
리턴 array

getIdTokenPayload() 공개 메소드

public getIdTokenPayload ( ) : array
리턴 array

getNonce() 보호된 메소드

Get stored nonce
protected getNonce ( ) : string
리턴 string

getProviderURL() 공개 메소드

public getProviderURL ( ) : string
리턴 string

getRedirectURL() 공개 메소드

Gets the URL of the current page we are on, encodes, and returns it
public getRedirectURL ( ) : string
리턴 string

getRefreshToken() 공개 메소드

public getRefreshToken ( ) : string
리턴 string

getState() 보호된 메소드

Get stored state
protected getState ( ) : string
리턴 string

getTokenResponse() 공개 메소드

public getTokenResponse ( ) : array
리턴 array

providerConfigParam() 공개 메소드

Use this to alter a provider's endpoints and other attributes
public providerConfigParam ( $array )
$array simple key => value

redirect() 공개 메소드

public redirect ( $url )
$url

refreshToken() 공개 메소드

Requests Access token with refresh token
public refreshToken ( $refresh_token ) : mixed
리턴 mixed

register() 공개 메소드

Dynamic registration
public register ( )

requestUserInfo() 공개 메소드

public requestUserInfo ( $attribute = null ) : mixed
$attribute string optional Attribute Type Description user_id string REQUIRED Identifier for the End-User at the Issuer. name string End-User's full name in displayable form including all name parts, ordered according to End-User's locale and preferences. given_name string Given name or first name of the End-User. family_name string Surname or last name of the End-User. middle_name string Middle name of the End-User. nickname string Casual name of the End-User that may or may not be the same as the given_name. For instance, a nickname value of Mike might be returned alongside a given_name value of Michael. profile string URL of End-User's profile page. picture string URL of the End-User's profile picture. website string URL of End-User's web page or blog. email string The End-User's preferred e-mail address. verified boolean True if the End-User's e-mail address has been verified; otherwise false. gender string The End-User's gender: Values defined by this specification are female and male. Other values MAY be used when neither of the defined values are applicable. birthday string The End-User's birthday, represented as a date string in MM/DD/YYYY format. The year MAY be 0000, indicating that it is omitted. zoneinfo string String from zoneinfo [zoneinfo] time zone database. For example, Europe/Paris or America/Los_Angeles. locale string The End-User's locale, represented as a BCP47 [RFC5646] language tag. This is typically an ISO 639-1 Alpha-2 [ISO639‑1] language code in lowercase and an ISO 3166-1 Alpha-2 [ISO3166‑1] country code in uppercase, separated by a dash. For example, en-US or fr-CA. As a compatibility note, some implementations have used an underscore as the separator rather than a dash, for example, en_US; Implementations MAY choose to accept this locale syntax as well. phone_number string The End-User's preferred telephone number. E.164 [E.164] is RECOMMENDED as the format of this Claim. For example, +1 (425) 555-1212 or +56 (2) 687 2400. address JSON object The End-User's preferred address. The value of the address member is a JSON [RFC4627] structure containing some or all of the members defined in Section 2.4.2.1. updated_time string Time the End-User's information was last updated, represented as a RFC 3339 [RFC3339] datetime. For example, 2011-01-03T23:58:42+0000.
리턴 mixed

setCertPath() 공개 메소드

public setCertPath ( $certPath )
$certPath

setClientID() 공개 메소드

public setClientID ( $clientID )
$clientID

setClientName() 공개 메소드

public setClientName ( $clientName )
$clientName

setClientSecret() 공개 메소드

public setClientSecret ( $clientSecret )
$clientSecret

setHttpProxy() 공개 메소드

public setHttpProxy ( $httpProxy )
$httpProxy

setNonce() 보호된 메소드

Stores nonce
protected setNonce ( string $nonce ) : string
$nonce string
리턴 string

setProviderURL() 공개 메소드

public setProviderURL ( $provider_url )
$provider_url

setRedirectURL() 공개 메소드

public setRedirectURL ( $url )
$url Sets redirect URL for auth flow

setResponseTypes() 공개 메소드

public setResponseTypes ( $response_types )
$response_types

setState() 보호된 메소드

Stores $state
protected setState ( string $state ) : string
$state string
리턴 string

unsetNonce() 보호된 메소드

Cleanup nonce
protected unsetNonce ( ) : void
리턴 void

unsetState() 보호된 메소드

Cleanup state
protected unsetState ( ) : void
리턴 void

urlEncode() 보호된 메소드

protected urlEncode ( string $str ) : string
$str string
리턴 string