kreactive / jsonwebtoken Goto Github PK
View Code? Open in Web Editor NEWSwift lib for decoding, validating, signing and verifying JWT
License: MIT License
Swift lib for decoding, validating, signing and verifying JWT
License: MIT License
When using the .podspec I get:
[!] Unable to read the license file (Project Folder)/Pods/JSONWebToken/LICENSE
for the spec JSONWebToken (1.0)
Hi!
This project is awesome, so thank you for this contribution. But I do have a question - when turning my token String into JSONWebToken type I don't get header part in the object. Is this left out on purpose and if so, why? Otherwise it would be really great if we could access it the same way as the payload.
There are transformers for almost all the JSON types in the library, except Boolean
. It would be great to add the Boolean Transformer for the sake of completeness.
Seems this package can be used token verification in Sign in with Apple.
how do I use it exactly? How do i get the secret and compare with "sub"?
When will this package be upgraded to support Swift 5 and Xcode 11?
Thanks
Ashish
CryptoSwift compatibility issues
Is there a cocoapod installer available?
Hi there
I need to mint a JWT using RS256 to use to validate a connection to a Google Firebase database via my app.
I have a Private Key from Firebase that looks something like:
"-----BEGIN PRIVATE KEY-----\nMIIEvQIBADds4tTHG53.........................................oBDP6N8=\n-----END PRIVATE KEY-----\n"
This is supplied in a string format and there are around 1600 characters in the key.
I can create the payload with the required claims, however I am struggling with taking the payload and creating a signed token using RSA256.
From your instructions I determined that I might need to do the following:
Use RSAPKCS1Signer to generate signed token:
let payload : JSONWebToken.Payload
let privateKey : RSAKey
let signer = RSAPKCS1Signer(hashFunction: .SHA256, key: privateKey)
let jwt = try JSONWebToken(payload : payload, signer : signer)
let rawJWT : String = jwt.rawString
The two issues I have is that the privateKey won't accept the Private Key string I have, I believe it is looking for a DER certificate format.
I also cannot see how to set it to use RSA256, which is a requirement for the Firebase Database.
Can you please help shed some light on how best to approach this?
Thanks for any help you can provide.
I am wondering if it is possible to publish the library?
Using the git ref pod 'JSONWebToken', :git => 'https://github.com/kreactive/JSONWebToken.git', :branch => 'master'
only works in a Podfile
and not a PodSpec
.
PodSpec's only support the following format and don't support using git branches, so its not possible to use the library via a PodSpec.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.