You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public function decode(string $token)
{
// The URI for the JWKS you wish to cache the results from
$jwksUri = "https://player-auth.services.api.unity.com/.well-known/jwks.json";
// Create an HTTP client (can be any PSR-7 compatible HTTP client)
$httpClient = new Client();
// Create an HTTP request factory (can be any PSR-17 compatible HTTP request factory)
$httpFactory = new HttpFactory();
// Create a cache item pool (can be any PSR-6 compatible cache item pool)
$cacheItemPool = CacheManager::getInstance('files');
$keySet = new CachedKeySet(
$jwksUri,
$httpClient,
$httpFactory,
$cacheItemPool,
null, // $expiresAfter int seconds to set the JWKS to expire
true // $rateLimit true to enable rate limit of 10 RPS on lookup of invalid keys
);
return JWT::decode($token, $keySet, ['RS256']);
}
@Kipjr thanks for sharing a tip to print the openssl_error_string, I believe it should be empty if openssl_verify succeeds. @qlixes was the above log shared by useful for you? It wasn't clear to me whether you wanted to just show the key in laravel or asking about auth?
step reproduce :
composer.json :
access_token :
while decoded access_token on https://jwt.io, success showed headers :
while add laravel Log, it shown empty key, so verify will "false".
Please let me know if I did something wrong.
Thank you a lot
The text was updated successfully, but these errors were encountered: