Code Monkey home page Code Monkey logo

Comments (6)

bretterer avatar bretterer commented on July 24, 2024 1

@rdkls thank you for the additional information here. I will add this to be investigated.

from okta-jwt-verifier-php.

bretterer avatar bretterer commented on July 24, 2024 1

@rdkls I have pushed an update to develop that will throw a Domain exception if there is no jwks_uri in the metadata.

#50

from okta-jwt-verifier-php.

abonne01 avatar abonne01 commented on July 24, 2024 1

Thanks.
What is process to update package list?
Still pointing to 1.0 here
https://packagist.org/packages/okta/jwt-verifier

thanks

from okta-jwt-verifier-php.

bretterer avatar bretterer commented on July 24, 2024

@elmacho777 can you please go into more detail of what is showing you that error? I am confused by where that error is coming from.

from okta-jwt-verifier-php.

rdkls avatar rdkls commented on July 24, 2024

I just had exactly the same issue. It happens if you're not paying for / using a customer auth server, as only custom auth servers metadata contain jwks_uri.

The problem is in JwtVerifier.php __construct
It retrieves metadata like so:
$this->metaData = json_decode($request->setUrl($this->issuer.$this->discovery->getWellKnown())->get()->getBody());

And just assumes the response contains jwks_uri. Which it only does for custom auth servers i.e. your base uri is of form https://${yourOktaDomain}/oauth2/${authServerId} NOT https://${yourOktaDomain}/oauth2

Then, in verify() it attempts to retrieve the (null) jwks_uri and gets that error
Traceback like so:

[16-Jul-2020 07:11:58 UTC] PHP Fatal error:  Uncaught InvalidArgumentException: URI must be a string or UriInterface in (php-dir)/vendor/guzzlehttp/psr7/src/functions.php:62
Stack trace:
#0 (php-dir)/vendor/php-http/message/src/UriFactory/GuzzleUriFactory.php(20): GuzzleHttp\Psr7\uri_for(NULL)
#1 (php-dir)/vendor/okta/jwt-verifier/src/Request.php(65): Http\Message\UriFactory\GuzzleUriFactory->createUri(NULL)
#2 (php-dir)/vendor/okta/jwt-verifier/src/Adaptors/FirebasePhpJwt.php(39): Okta\JwtVerifier\Request->setUrl(NULL)
#3 (php-dir)/vendor/okta/jwt-verifier/src/JwtVerifier.php(94): Okta\JwtVerifier\Adaptors\FirebasePhpJwt->getKeys(NULL)
#4 (php-dir)/index.php(447): Okta\JwtVerifier\JwtVerifier->verif in (php-dir)/vendor/guzzlehttp/psr7/src/functions.php on line 62

from okta-jwt-verifier-php.

bretterer avatar bretterer commented on July 24, 2024

Internal Ref: OKTA-314097

from okta-jwt-verifier-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.