FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login
    1. Home
    2. gokul.mahajan20
    G
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    gokul.mahajan20

    @gokul.mahajan20

    0
    Reputation
    1
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    gokul.mahajan20 Unfollow Follow

    Latest posts made by gokul.mahajan20

    • Verification of ID Token using RSA public key

      Hey All
      Just wondering if I am doing something wrong here. I am using FusionAuth java library https://github.com/FusionAuth/fusionauth-jwt.

      Java Code :

          ```List<JSONWebKey> keys = JSONWebKeySetHelper.retrieveKeysFromJWKS("http://localhost:9011/.well-known/jwks.json");
          Map<String, Verifier> publicKeyVerifiers = new HashMap<String,Verifier>();
          for (JSONWebKey key : keys) {
              String publicKey = key.x5c.get(0);
              Verifier verifier = RSAVerifier.newVerifier(publicKey); 
              String kid = key.kid;
              publicKeyVerifiers.put(kid, verifier);
          }```
      

      Exception I am getting :
      InvalidParameterException : Unexpected PEM Format

      I think the problem here is that if we look at the "key.x5c" from jwks.json, it does not start with "-----BEGIN" and hence it is throwing above exception.
      The FusionAuth library class io.fusionauth.pem.PEMDecoder expect "-----BEGIN" which does not exist.
      Screenshot of jwks.json

      90cedaa7-e260-4ea5-8a51-1f58fb3a9976-image.png

      posted in General Discussion rsa jwks verification validation client-library
      G
      gokul.mahajan20
    • Java verification code for HS256 signed id token

      How to verify HS256 ID Token using FusionAuth java Client libraries ?

      Description: I have created an app in FusionAuth that has a Clinet ID and Client Secret generated, I have not touched any other section/tab like JWT etc, default JWT signing algo is OIDC standard HMAC SHA256.

      I tried using following code approach to validate the token based on public key, but its not working for HS256 signed token, I searched over internet and found public key is not applicable for HS256

      Could you please provide me a Java code to verify HS256 signed token using FusionAuth Java client libraries (https://github.com/FusionAuth/fusionauth-jwt).
      Please also let me know that do I need any additional configuration on FusionAuth Admin Console.

      Code which I tried: Its giving blank public keys.

          List<JSONWebKey> keys = JSONWebKeySetHelper.retrieveKeysFromJWKS("http://localhost:9011/.well-known/jwks.json");
      
          Map<String, Verifier> publicKeyVerifiers = new HashMap<String, Verifier>();
      
          JWT jwtDecoded = JWT.getDecoder().decode(idToken, publicKeyVerifiers);
      
      posted in Q&A
      G
      gokul.mahajan20