Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Raw ClaimSet Data #69

Open
jupl opened this issue Apr 27, 2017 · 8 comments
Open

Get Raw ClaimSet Data #69

jupl opened this issue Apr 27, 2017 · 8 comments

Comments

@jupl
Copy link

jupl commented Apr 27, 2017

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.

@benguild
Copy link

I also need this, or the best possible way to convert to an NSDictionary for an Objective-C implementation.

@kashiftriffort
Copy link

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.

@benguild
Copy link

benguild commented Jun 14, 2017

@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

@kashiftriffort
Copy link

kashiftriffort commented Jun 14, 2017

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.

@jshier
Copy link

jshier commented Oct 24, 2017

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.

@benguild
Copy link

I don’t know what the status of this is but I still believe it is overly abstracted.

Wooder pushed a commit to Wooder/JSONWebToken.swift that referenced this issue Jan 20, 2018
As described in issue
kylef#69 in some cases
access to the raw json data is needed. Therefore „claims“ should be
exposed.
@Wooder
Copy link

Wooder commented Jan 20, 2018

I 've created a pull request that makes "claims" accessible for reading.
See #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.

@dzpt
Copy link

dzpt commented Dec 9, 2018

@Wooder [!] Unable to find a specification for 'JSONWebToken'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants