# OpenID Connect ID Token parser library

This library is a wrapper and helper using `lcobucci/jwt` package which parses ID tokens and verifies their signature.

# Installation

`composer require authstack/oidc-id-token`

# Use

```php
<?php

use function AuthStack\OIDC\id_token;

$jwt = '.....'; // the json web token
$signer = new Lcobucci\JWT\Signer\Rsa\Sha256;
$pubKey = 'your public key goes here';

$token = id_token($jwt, $signer, $pub_key);

// Get the subject claim
$token->getClaim('sub');

// Get all claims
$token->getClaims();
```