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
Adding claim names #254
Comments
Hi @netgfx, you can use anything that's let payload = Payload("anything you want".data(using: utf8)!) If you're looking for a purpose built JWT library, it might make sense to check out what's available at jwt.io. JOSESwift is only aiming at providing the underlying JOSE (JWS/JWE/JWT) groundwork. |
What is your payload? From the jwt.io error message it seems it's not valid JSON. Keep in mind that signed JWTs are a special subset of valid JWSs. Every signed JWT is a JWS but not every JWS is a JWT. Nothing will stop you from creating JWTs using JSOESwift. But nothing will stop you from creating a JWS which is not valid JWT either. |
The payload is this: |
JSON required strings to be in double quotes. If you get your payload to be a valid JSON, I'm pretty sure it'll work. |
I got it working, if it helps anyone I had to convert a dictionarty into a JSON string through the JSONEncoder.
Then
|
Good to hear you got it to work. Just to be clear though, the payload can be any |
Hello,
Is it possible to include claim names https://tools.ietf.org/html/rfc7519#section-4.1 like:
on the payload?
Is there a proposed way to do this? I see that that JWSHeader contains some exposed properties.
Thanks.
The text was updated successfully, but these errors were encountered: