yourkarma / JWT

A JSON Web Token implementation in Objective-C.
MIT License
351 stars 107 forks source link

'secret' is deprecated: deprecated. will be removed in release version: 3.0 #100

Closed mathiarasan24 closed 7 years ago

mathiarasan24 commented 7 years ago

Hi,

I tried to check my secret token with limitations code, What's new in version 2.0 and Some of this code too. I got deprecated from everywhere. I don't know this is correct method or not. I just copy and past above code replace secret with my token that it. I am using xcode 8.0. JWT from pod pod 'JWT'.

NSString *jwtToken = @"header.payload.signature"; NSString *algorithmName = @"HS256"; //Must specify an algorithm to use NSDictionary *payload = [JWTBuilder decodeMessage:jwtToken].secret(secret).algorithmName(algorithmName).decode;

Every code I got this error from secret(secret).

My scenario: I have an access token, from that I need timestamp details. I didn't find any alternative code in that can you help me to find out?

Thanks

lolgear commented 7 years ago

secret and algorithm are deprecated due to upcoming version 3.0. You can still use them. They will be moved to different place.

mathiarasan24 commented 7 years ago

Thank for your reply. After I update version 3.0 then I need too update my code?

lolgear commented 7 years ago

@mathiarasan24 two scenarios.

First: I will make branch 2.0 with full support, remove all warnings and all. Second: I will make version 2.2 and drop support of version 2.

The interfaces will be changed in version 3.0. Now I am playing with some of them. Before version 3.0 I am planned to make several prereleases 3.0beta.

All of that stuff in 3.0 related to weak decoupling of algorithm, secret, payload etc.

lolgear commented 7 years ago

@mathiarasan24, please, have a look at new version!

https://github.com/yourkarma/JWT/releases/tag/3.0.0-beta.1

lolgear commented 7 years ago

could be closed?

mathiarasan24 commented 7 years ago

Yes, sure.