Closed mitchellthomas186 closed 7 years ago
@mitchellthomas186 does previous issue related to yours? #138
No, I have a public key that is generated server side and the error I get is that the data is not base 64 encrypted.
On Aug 15, 2017 1:04 PM, "Dmitry" notifications@github.com wrote:
@mitchellthomas186 https://github.com/mitchellthomas186 does previous issue related to yours? #138 https://github.com/yourkarma/JWT/issues/138
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yourkarma/JWT/issues/139#issuecomment-322573355, or mute the thread https://github.com/notifications/unsubscribe-auth/AEBMxvs4pPWuQdIDG1LsQMWHzrhv-JhMks5sYfnLgaJpZM4O3y6B .
@mitchellthomas186 try to create dataHolder with signKey/verifyKey item. ( .verifyKey()
)
JWTPublicKey -initWithPemBase64
will help you.
@mitchellthomas186 I checked your example via tests project. Everything decoded fine. However, when I decoded your example via Inspection project, it fails. Need more observations.
I can't find the class JWTPublicKey in any of the repo files, and xcode is throwing an error when I try to call it.
Give that I have a public key as a string, can you tell me the actual code I need to use to verify the signature part of a JWT using your JWT pod?
I also have the same issue. I checked token and public key via jwt.io and they are correct, however the following code results in a decode error:
NSString *token = @"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ik0wSkVNemM0TlRnNE9VVTJOa00wT1VWQlJFUXlSVU01UkVJNU5EWkVSRGxETTBORFFqQkdNUSJ9.eyJpc3MiOiJodHRwczovL3RpdHplLmV1LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHw1OTlhZGU2OGU0OTQyZDQ0NjlkMWJhMTkiLCJhdWQiOiJMR1VaWXhrMExqQWRSdTEwOENGaTZ3Wnp0WVVWUDJIOSIsImlhdCI6MTUwNDcwNTQ2MiwiZXhwIjoxNTA0NzQxNDYyLCJub25jZSI6IkI3OUUwOTVFLTlFQ0ItNDE3Ri1COUFGLUQxRDJCMUNFREI2RCJ9.iS65VP9DAIjf-ju-Cifokk9C1hhIFPb1O4IUpTKaXEg9myDswVbtRP287g6fR1OTpmY-W48VWJXYFbbYwvvav1yWlEu7RqfpOVWaqCSeb9xn71FsuSg0OdyKkJWHMarjrxYcnUxC-0oIgBNW-W2z_1Xv5lHtnnbCsphoNfgz6GmLoL5QQFxLf_JMdhMlzGvPQruOlQVz5UF8dQwTJOzBvAwnTEyGtusVQsVEFw87Apg14A1iPT_-dT1zo8uMz0F23oc_seMuwY4fhFoIEwPuwRGpVYpmvnFSvEUxblF9x7CMGmmcSF0LMGwAoxnN2SXo0yFR2xn7hhn3H2hJmoAf-w";
NSString *publicKey = @"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxaGtLsyJZQpQ3kkw0SxjLVvLCAR/WQlvN7uB6n0pqtA0uXufe1+TB8bw4wvzfqNCLUuzef3cFukYwGObSdwXUE/3kZpYNeqAkKy11yL4P35EWdg4KfPJZ+eJHlwL4feVekohaeGvrDtpVfKj3zYjYZhcbJFw/DUl2BnZht2vlwWcA4r4S8CgjWQATDjbKkac55r65HJ2G3fPU+XOOrepzVLLJcRZMGP3bWbdvUYpVpTwSA8rJGutrghOQqBIvR6ZIILyk/FNaqJz8vgkzbgu+1s5XHK64dEjM1j9em2UWa/5fG5IIJqD+sMrxqi8GOIl40mGqP/h/2Hz4WMd/89axQIDAQAB";
JWTBuilder *decodeBuilder = [JWTBuilder decodeMessage:token].secret(publicKey).algorithmName(@"RS256");
NSDictionary *envelopedPayload = decodeBuilder.decode;
@Clax666
JWTBuilder
is deprecated and may not be correct in new features.
Try API 3.0
JWTEncodingBuilder
JWTDecodingBuilder
@Clax666 any updates?
I can confirm that everything is ok with API 3.0
2017-10-18 16:27 GMT+02:00 Dmitry notifications@github.com:
@Clax666 https://github.com/clax666 any updates?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yourkarma/JWT/issues/139#issuecomment-337609704, or mute the thread https://github.com/notifications/unsubscribe-auth/AeSzJ4gpuBn3FLsE1l92ypN-NOCnbT6tks5stgrVgaJpZM4O3y6B .
@Clax666 Could it be closed?
Yes, to me it can be closed
2017-10-18 16:37 GMT+02:00 Dmitry notifications@github.com:
@Clax666 https://github.com/clax666 Could it be closed?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yourkarma/JWT/issues/139#issuecomment-337612858, or mute the thread https://github.com/notifications/unsubscribe-auth/AeSzJ5QKX08XYnjr_47v0xEBNkkru_CWks5stg0NgaJpZM4O3y6B .
New Issue Checklist
Issue Info
Issue Description and Steps
Verification fails when calling verifyPublicKeyPemString function with a valid public key from decodePubKey function.
The token and public key have both been verified on jwt.io.
All I want to do is verify that the signature is valid - is there an error in my code, or is there a different way of doing this?
public key from .pem file: