Merge pull request #16 from rwasef1830/token_type_case_insensitive

Fix issue #15
isekai
Robert Staddon 8 years ago committed by GitHub
commit 5d0ad04123

@ -228,7 +228,7 @@ class OpenID_Connect_Generic_Client {
// we need to ensure 3 specific items exist with the token response in order // we need to ensure 3 specific items exist with the token response in order
// to proceed with confidence: id_token, access_token, and token_type == 'Bearer' // to proceed with confidence: id_token, access_token, and token_type == 'Bearer'
if ( ! isset( $token_response['id_token'] ) || ! isset( $token_response['access_token'] ) || if ( ! isset( $token_response['id_token'] ) || ! isset( $token_response['access_token'] ) ||
! isset( $token_response['token_type'] ) || $token_response['token_type'] !== 'Bearer' ! isset( $token_response['token_type'] ) || strcasecmp( $token_response['token_type'], 'Bearer' )
) { ) {
return new WP_Error( 'invalid-token-response', 'Invalid token response', $token_response ); return new WP_Error( 'invalid-token-response', 'Invalid token response', $token_response );
} }

Loading…
Cancel
Save