okta-sdk-php
okta-sdk-php copied to clipboard
Fatal error: Uncaught Error: Cannot instantiate interface Lcobucci\JWT\Signer\Key
$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.