Code Monkey home page Code Monkey logo

Comments (7)

longsleep avatar longsleep commented on June 12, 2024 1

Thanks for your feedback!

I tried to verify the token using various verification libraries and non of them understands PS256.

This is sad for them, since PS256 is pretty much the way to go if you want to avoid potentially insecure RSA PKCS#1 signatures with keys with low exponent (Bleichenbacher).

Is there a config option to change this?

Yes.

      --signing-method string                 JWT signing method (default "PS256")            

as command line argument when starting Konnect. It defines what algorithm is used.

For RSA keys you can switch to any of the PKCS#1 based variants (RS256,RS384,RS512). Konnect also supports ECDSA keys with ES256,ES384,ES512).

from konnect.

longsleep avatar longsleep commented on June 12, 2024 1

Switching to RS256 fixes this. THX for now - let's see what needs to be done these days to support PS256.

Its a valid workaround. Konnect will refuse to start with a RSA key with low exponent anyways (see

if rsaPrivateKey.PublicKey.E < 65537 {
return fmt.Errorf("RSA signing key with public exponent < 65537")
)

I doubt that there are still SSL libraries out there who generate such keys when using their default settings. So should be good enough to use RS256 in production.

from konnect.

DeepDiver1975 avatar DeepDiver1975 commented on June 12, 2024

THX a lot @longsleep - I'll give that a try ....

from konnect.

longsleep avatar longsleep commented on June 12, 2024

THX a lot @longsleep - I'll give that a try ....

You are welcome. You seem to use okta-jwt-verifier-php which either uses spomky-labs/jose or firebase/php-jwt where firebase/php-jwt does not support RSA-PSS but spomky-labs/jose does (according to their docs at https://packagist.org/packages/spomky-labs/jose). Maybe you can use spomky-labs/jose?

from konnect.

DeepDiver1975 avatar DeepDiver1975 commented on June 12, 2024

You are welcome. You seem to use okta-jwt-verifier-php which either uses spomky-labs/jose or firebase/php-jwt where firebase/php-jwt does not support RSA-PSS but spomky-labs/jose does (according to their docs at https://packagist.org/packages/spomky-labs/jose). Maybe you can use spomky-labs/jose?

No idea why but they seem to only allow RS256 - no idea why.
https://github.com/okta/okta-jwt-verifier-php/blob/1cef6069221c31607806b54b7d36bd610aecaa13/src/Adaptors/SpomkyLabsJose.php#L36

But even if i set this to PS256 it does not verify the token.

from konnect.

DeepDiver1975 avatar DeepDiver1975 commented on June 12, 2024

No idea why but they seem to only allow RS256 - no idea why.

Raised okta/okta-jwt-verifier-php#24

from konnect.

DeepDiver1975 avatar DeepDiver1975 commented on June 12, 2024

Switching to RS256 fixes this. THX for now - let's see what needs to be done these days to support PS256.

from konnect.

Related Issues (15)

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.