oauth2-server-php-docs icon indicating copy to clipboard operation
oauth2-server-php-docs copied to clipboard

The crypto token validation docs are wrong

Open bshaffer opened this issue 11 years ago • 1 comments
trafficstars

see https://github.com/bshaffer/oauth2-server-php/issues/317:

The docs specify that you should base64_decode the signature before passing it to openssl_verify. This will fail because the signature is not base64 encoded, it is "url safe base64 encoded", so the decode needs to be Jwt::urlSafeB64Decode, or its contents:

    $b64 = str_replace(array('-', '_'), array('+', '/'), $b64);
    return base64_decode($b64);

bshaffer avatar Apr 05 '14 00:04 bshaffer

+1

wpromatt avatar Jan 06 '15 04:01 wpromatt