pmill / aws-cognito

A PHP library for AWS Cognito user pools
MIT License
74 stars 62 forks source link

file_get_contents in function downloadJwtWebKeys #27

Closed mschmie closed 5 years ago

mschmie commented 5 years ago

I get a timeout when trying to get jwks.json. I think its because of file_get_contents. With curl_exec it does work. Could it be the problem, that I am behind a proxy? Maybe we should than give the possibility to define a proxy maybe via config.php and use it in file_get_contents.

pmill commented 5 years ago

Hello

There is a CognitoClient::setJwtWebKeys() function where you can download the keys using your own implementation. You should be able to use your curl function in your own code, call JWKSet::createFromJson($json); on the response and then set them using this method.