Skip to content
This repository was archived by the owner on Jan 26, 2025. It is now read-only.
This repository was archived by the owner on Jan 26, 2025. It is now read-only.

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

Description

@baruchespinoza
        $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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions