Leveraging Intelligent Recommendations for Operational Transformation. AMS Partners click HERE | EMEA/APJ Partners click HERE |
07/02/2024 03:48 AM
Hi Team,
Could someone help me in signing the JWT? I have Key ID and Private Key with me.
Regards,
Sivateja
Solved! Go to Solution.
07/02/2024 12:06 PM
If you prefer to use an online tool, you can use jwt.io to manually create and sign your JWT.
Open jwt.io: Go to jwt.io.
Header: Enter the header in the "Decoded" section. It will typically look like this:
Payload: Enter your payload. For example:
Signature: Paste your private key into the "Verify Signature" section. Make sure to remove the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- lines and any whitespace.
Copy JWT: The signed JWT will be generated in the "Encoded" section at the top. You can copy it from there.
Make sure to replace placeholders like YOUR_KEY_ID, subject, issuer, and path/to/your/private-key.pem with your actual values and paths.
07/10/2024 07:07 AM
Hi
On the signature part, it is asking for both Private key and Public key when I select the algorithm ES256. But I only had private key with me.
Due to this it is throwing an error like invalid signature.
07/10/2024 07:27 AM
Hi @Sivateja are you trying to create JWT online or in saviynt?
07/10/2024 07:35 AM
Hi @NM ,
Yes, I tried with JWT.IO as recommended.
But, I need to do this in Saviynt as well. I have followed the developer guide for creating connection JSON for JWT authentication. But it is getting failed.
To ensure that I checked in jwt.io as well. There are also it is saying invalid signature.
07/10/2024 07:38 AM
@Sivateja you only have to add private key .. no need to add public.. what error do you get
Share connection json... Mask confidential values..
07/10/2024 07:45 AM
Here is the connection JSON
{
"authentications": {
"acctAuth": {
"authType": "Jwt",
"httpParamsName": "assertion",
"jwtConfig": {
"jwtHeader": {
"alg": "ES256",
"typ": "JWT",
"kid": "*********"
},
"jwtPayload": {
"iss": "******",
"sub": "user",
"aud": "appstoreconnect-v1",
"scope": "https://api.appstoreconnect.apple.com/v1/users"
},
"signedAlgorithm": "ES256",
"key": "-----BEGIN PRIVATE KEY----- ********** -----END PRIVATE KEY-----",
"jwtExpiryDuration": 120
},
"url": "https://api.appstoreconnect.apple.com",
"httpMethod": "POST",
"httpParams": {
"grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer"
},
"httpContentType": "application/x-www-form-urlencoded",
"retryFailureStatusCode": [
401,
500,
400
],
"authError": [
"SESSION_NOT_VALID",
"AuthenticationFailed",
"ExpiredJwtException",
"401 Unauthorized",
"401",
"You couldn't be authenticated"
],
"errorPath": "code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "abc"
}
}
}
07/10/2024 07:56 AM
@Sivateja, no need to add begin and end in key field of connection json
07/10/2024 07:57 AM
@NM I tried by removing them only. Just for reference I have given here.
07/10/2024 08:05 AM