Get Raw ClaimSet Data
I'm using let payload: Payload = try JWT.decode(...) to get the dictionary data to pass off to a 3rd party library. I'm getting a deprecated notice so I try let claimSet: ClaimSet = JWT.decode(...); claimSet.claims but get the error 'claims' is inaccessible due to 'internal' protection level.
EDIT: Forgot to mention I'm using Carthage.
I also need this, or the best possible way to convert to an NSDictionary for an Objective-C implementation.
How can we use this in Objective-C any Idea. I have used cocoapods file for Swift, but calling JWT file in Objective-C not working.
@kashiftriffort You need to wrap the methods you need in a bridge file. However, this issue is specifically surrounding the fact that the code was changed recently and it's now throwing a warning that a certain method that helped enable this is deprecated.
'decode(_:algorithms:verify:audience:issuer:)' is deprecated: use decode that returns a ClaimSet instead
I don't think we need a bridge file for this, after Cocopods installed, I can directly called #import "JWT-Swift.h", into Objective-C file and option for bridging header is not provided in Objective-C target. If you give me any support that will be great help for me.
I also need the data, as I have an API which returns a JWT body for certain responses, which I would like to feed to JSONDecoder. For now I've forked and make claims public, and I convert that back to JSON data before decoding.
I don’t know what the status of this is but I still believe it is overly abstracted.
I 've created a pull request that makes "claims" accessible for reading. See https://github.com/kylef/JSONWebToken.swift/pull/99
If you need a "fast solution" you can use my forked version pod 'JSONWebToken', :git => 'https://github.com/Wooder/JSONWebToken.swift.git' as temporary workaround.
@Wooder [!] Unable to find a specification for 'JSONWebToken'.