Im trying to make a SSO validation on thinktecture OpenId connect in PHP I have written a client and get an access token. BUT i cannot find out how to validate it.
The documentation says: 3.2.2.9. Access Token Validation
To validate an Access Token issued from the Authorization Endpoint with an ID Token, the Client SHOULD do the following:
Hash the octets of the ASCII representation of the access_token with the hash algorithm specified in JWA [JWA] for the alg Header Parameter of the ID Token's JOSE Header. For instance, if the alg is RS256, the hash algorithm used is SHA-256.
Take the left-most half of the hash and base64url encode it.
The value of at_hash in the ID Token MUST match the value produced in the previous step.
I have no idea how to make step 1. I got the ALg as RS256 and i have the at_hash from the Id token, i just cant find an exampel in PHP on how to do the validation.
Here is an example in PHP to calculate the
at_hash
value that should be easy to adapt to your environment: