Questions tagged [jose4j]

The jose4j library is an open source (Apache 2.0) implementation of JWT and the JOSE specification suite. It is written in Java and relies solely on the JCA APIs for cryptography.

JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. JWT is the identity token format in OpenID Connect and it is also widely used in OAuth 2.0 and many other contexts that require compact message security.

JOSE is short for Javascript Object Signing and Encryption, which is the IETF Working Group that developed the JSON Web Signature (JWS), JSON Web Encryption (JWE) and JSON Web Key (JWK) specifications. JWS and JWE use JSON and base64url encoding to secure messages in a (relatively) simple, compact and web safe format while JWK defines a JSON representation of cryptographic keys. The actual algorithms for JWS, JWE and JWK are defined in JSON Web Algorithms (JWA). The library supports the JWS/JWE compact serializations with the complete suite of JOSE algorithms.

The homepage for jose4j is at: https://bitbucket.org/b_c/jose4j/wiki/Home

84 questions
0
votes
1 answer

CAS 6.5 not able to use jose4J package to validate JWT

I am upgrading from 5.3 to 6.5 and getting errors using the Jose4J package to validate the JWTs CAS is generating. From what I can tell after jose4j's JWE decrypts the JWT the content type header “cty” is “JWT” indicating that the JWT is still in a…
Jason
  • 1
  • 2
0
votes
1 answer

JWT add different subject depending on the data in the body

I've been asked to generate a token depending on the username that is asking for it. Now I'm creating a token just with a single subject but I don't know how to change the subject dinamically before creating the token depending on the body of the…
DiegoMG
  • 383
  • 1
  • 4
  • 18
0
votes
1 answer

Generating JWK with a private key while using jose4j to generate JWS

I am trying to generate a JWK using my private key while using jose4j library to generate a JWE with the earlier mentioned JWK. But the key generated doesn't seem to be correct, also, it doesn't have all the fields (only n, e and kty get generated ,…
Prakhar
  • 41
  • 6
0
votes
1 answer

Jwt list of audience in Spring

When creating the token, I've set a list of audience as follows: JwtClaims claims = new JwtClaims(); claims.setIssuer(issuer); claims.setAudience(Lists.newArrayList(audiences)); …
DiegoMG
  • 383
  • 1
  • 4
  • 18
0
votes
1 answer

JWT signing with public and private key

I have written this portion of code to create a JWT. public String createJWT() throws JoseException { RsaJsonWebKey rsaJsonWebKey = RsaJwkGenerator.generateJwk(2048); // Give the JWK a Key ID (kid), which is just the polite thing…
DiegoMG
  • 383
  • 1
  • 4
  • 18
0
votes
3 answers

How to Create a JWT in Java with the secret base64 encoded and jose4j

https://jwt.io/#debugger-io?token=eyJhbGciOiJIUzUxMiJ9.eyJ1c2VySWQiOiJsaWh6NiIsInN1YiI6ImxpaHo2IiwiZXhwIjoxNjQ3OTIwNzU3fQ.voGK_UVv0ezNGj42XSDa-x4XojXr-qwmc-VnB_zZKxXHrQZE1agD-YAfeINnTOg0H8XZ3_qdyQGHcUCf5ruHvA I use E2ABA91===! as key and check…
abc45628
  • 51
  • 7
0
votes
1 answer

How do i tell which repository/artifact on mvnrepository.com is more widely adopted? nimbus-jose-jwt vs jose4j

I am trying to figure out whether i should pick(based on the adoption): -nimbus-jose-jwt - Used By 279 artifacts OR -jose4j - Used by 655 artifacts I found that jose4j 's author, Brian Campbell, is active, based on the commits, it has the features…
jumping_monkey
  • 5,941
  • 2
  • 43
  • 58
0
votes
1 answer

What does the method setGeneratedJwtId() from the org.jose4j.jwt.JwtClaims do?

I am trying to create JWT which needs to be sent to an external token endpoint. The external provider requires the POST body to have a JWT which is made up of several parameters, one among them is "jti". I went through the doc and know what "jti" is…
Q2Dev
  • 85
  • 1
  • 9
0
votes
0 answers

JWT.io Signature Validation

I'm creating a JWT within Mirth and sending the constructed message out to an oauth2 server but it keeps erroring. When I put the JWT into jwt.io I get valid header and payload information but my signature is coming back as invalid and I can't…
jc84
  • 11
  • 1
0
votes
1 answer

jose4j, decrypt JWE with symmetric key

I'm trying to reproduce a decoding of a JWE starting from jwt.io as an example and translating into code by using library jose4j From site jwt.io I have the following: HEADER: { "alg": "HS256" } PAYLOAD: { "sub": "1234567890", "name":…
Fabrizio Stellato
  • 1,727
  • 21
  • 52
0
votes
1 answer

How to generate jose4j EllipticCurveJsonWebKey from JSON web key

I am able to create JWE as per https://bitbucket.org/b_c/jose4j/wiki/JWT%20Examples. Problem: Unable to create JWE (EC type as mentioned below) using json web key. Requirement: Create & Verify below type of JWE "typ": "JWT", "alg":…
0
votes
1 answer

Extract body of a JWT as a JSON using Jose4J

I'd like to extract body of a JWT as a JSON using Jose4j. Is this possible? We need to support a custom validation that can be arbitrarily easy or very complex depending on the customer. We need the body in the form of a JSON, so that we can pass it…
0
votes
2 answers

How to verify custom key-pair value in a JWT body

I'm implementing a JWT solution and I'm using jose4j. I'm facing the problem that I have non-standard/custom key-pair value (such as "application-id" : 124123) in the body of the JWT that I want to verify, but I can't find the way to do it in…
0
votes
0 answers

Can't verify JWT with jose4j with header at null in a CompactSerialization form

I'm trying to play with jose4j and for example I tried to verify JsonWebSignature without setting the first part of CompactSerialization (as we use unprotected header). It returns me org.jose4j.lang.JoseException: Parsing error:…
Jeremy
  • 13
  • 3
0
votes
2 answers

how to create jwk key for canvas?

In canvas, in order to have an LTI app authenticate, the site admin has enter the JWK for the remote site. The format of a JWK is well defined: { "kty":"RSA", "kid":"...", "use":"sig", "alg":"RS256", "n":"u6gqiV...", "e":"AQAB" } First, can we use…
Dov
  • 8,000
  • 8
  • 46
  • 75