Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Fatal error: Uncaught Error: Cannot instantiate interface Lcobucci\JWT\Signer\Key #142

Open
baruchespinoza opened this issue Feb 25, 2022 · 0 comments

Comments

@baruchespinoza
Copy link

        $client = (new \Okta\ClientBuilder)
            ->setOrganizationUrl($orgUrl)
            ->setAuthorizationMode(new \Okta\Utilities\AuthorizationMode(\Okta\Utilities\AuthorizationMode::PRIVATE_KEY))
            ->setClientId($clientId)
            ->setScopes("okta.users.read okta.apps.read")
            ->setPrivateKey("{{PEM PRIVATE KEY BLOCK}}")
            ->build();

Seems to trigger this error.
I believe the reason is that the code wasn't updated to use version 4.* of lcobucci/jwt.

In vendor/okta/sdk/src/Utilities/PrivateKeyAuthentication.php:58 the SDK tries to instantiate Lcobucci\JWT\Signer\Key but as of version 4.0.0 that is not a class anymore, it's an interface, hence the error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant