Add two filters to modify received $token_response and $id_token_claim before validation

This is related to daggerhart/openid-connect-generic#155
isekai
Karlo Šimunović 5 years ago
parent f42a587bf0
commit 47ea6d6ec3

@ -298,6 +298,9 @@ class OpenID_Connect_Generic_Client_Wrapper {
// get the decoded response from the authentication request result
$token_response = $client->get_token_response( $token_result );
// allow for other plugins to alter data before validation
$token_response = apply_filters( 'openid-connect-modify-token-response-before-validation', $token_response );
if ( is_wp_error( $token_response ) ){
$this->error_redirect( $token_response );
}
@ -319,6 +322,9 @@ class OpenID_Connect_Generic_Client_Wrapper {
// e.g. for the userinfo endpoint
$id_token_claim = $client->get_id_token_claim( $token_response );
// allow for other plugins to alter data before validation
$id_token_claim = apply_filters( 'openid-connect-modify-id-token-claim-before-validation', $id_token_claim );
if ( is_wp_error( $id_token_claim ) ){
$this->error_redirect( $id_token_claim );
}

Loading…
Cancel
Save