PHP code example of danielburger1337 / openid-hash

1. Go to this page and download the library: Download danielburger1337/openid-hash library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

danielburger1337 / openid-hash example snippets



    use danielburger1337\OpenIdHash\OpenIdHash;

    $instance = new OpenIdHash('RS256');
    // see also "verifyCodeHash", "verifyStateHash"
    $isValid = $instance->verifyAccessTokenHash('access token', 'The "at_hash" claim of the ID Token');
    // bool


    use danielburger1337\OpenIdHash\OpenIdHash;

    $instance = new OpenIdHash('EdDSA', 'Ed448');
    // see also "createCodeHash", "createStateHash"
    $hash = $instance->createAccessTokenHash('YmJiZTAwYmYtMzgyOC00NzhkLTkyOTItNjJjNDM3MGYzOWIy9sFhvH8K_x8UIHj1osisS57f5DduL');

    print $hash; // sB_U72jyb0WgtX8TsVoqJnm6CD295W9gfSDRxkilB3LAL7REi9JYutRW_s1yE4lD8cOfMZf83gi4