PHP 클래스 Discourse_SSO

파일 보기 프로젝트 열기: discourse/wp-discourse 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $secret ) Discourse_SSO constructor.
build_login_string ( array $params ) : string Creates the sso-login query params that are sent to Discourse.
get_nonce ( string $payload ) : mixed Gets the nonce from the payload.
validate ( string $payload, string $sig ) : boolean Validates the payload against the sig.

메소드 상세

__construct() 공개 메소드

Discourse_SSO constructor.
public __construct ( string $secret )
$secret string The SSO secret key.

build_login_string() 공개 메소드

Creates the sso-login query params that are sent to Discourse.
public build_login_string ( array $params ) : string
$params array The array of parameters to send.
리턴 string

get_nonce() 공개 메소드

Gets the nonce from the payload.
public get_nonce ( string $payload ) : mixed
$payload string A Base64 encoded string.
리턴 mixed

validate() 공개 메소드

Validates the payload against the sig.
public validate ( string $payload, string $sig ) : boolean
$payload string A Base64 encoded string.
$sig string HMAC-SHA256 of $sso_secret, $payload should be equal to $sig.
리턴 boolean