Questions tagged [jjwt]

Use when referencing the JJWT library for the JVM and Android

The JJWT library for the JVM and Android: https://github.com/jwtk/jjwt

138 questions
0
votes
1 answer

how should i use JWT in android?

I want to use jjwt to create a login activity. so i don't know how to use it . i read it in https://github.com/jwtk/jjwt but i couldn't understand because my English is not fluent. i want you to give me an example to understand it. should i send…
Mohammad
  • 11
  • 6
0
votes
1 answer

Spring Boot Jwt returns access denied

Hey everyone i have problem with jwt with Java.Here is the codes. Here is returned value from postman { "timestamp": "2020-02-29T20:53:35.761+0000", "status": 403, "error": "Forbidden", "message": "Access Denied", "path":…
isa_toltar
  • 586
  • 5
  • 11
0
votes
1 answer

Why does my code skip the try statement and go directly to the catch?

I am trying to decode a JWT token string entered by a user and verifying the signature, I am using the io.jsonwebtoken library. I got the "key" by using the "openssl rand -base64 32" command in my terminal. I am currently using…
cjpayan
  • 1
  • 1
0
votes
1 answer

i'm having trouble creating a JWT with JJWT library

i'm having trouble creating a JWT with the JJWT library : https://github.com/jwtk/jjwt I have followed the instructions and came up with this simple class: import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jws; import…
victor
  • 5
  • 3
0
votes
1 answer

Generate the token that can be validated against RSA signing key in azure

I am using an Azure B2C custom policy where I want to send an invitation link to the user, with JWT token containing necessary details. I need to create the JWT token in JAVA. Using the jjwt library I was successful in creating a token using HS256,…
0
votes
1 answer

Getting java.lang.NoSuchMethodException: io.jsonwebtoken.impl.crypto.MacProvider.generateKey only in case of jUnits

I have recently started getting following exception, only when junits are being run. In normal flow, the method runs fine. (In fact even the jUnits used to work fine till some time back) java.lang.NoSuchMethodException: …
tryingToLearn
  • 10,691
  • 12
  • 80
  • 114
0
votes
1 answer

Jjwt throws signature error when validates a jwt token generated from php

I need to add a PHP application in a SSO built using a CAS in Java. After authentication of the user, the SSO sends the credintials to the PHP App and the token is built using the code below: public function getToken(Signer $signer = null, Key $key…
leo valeriano
  • 810
  • 8
  • 8
0
votes
1 answer

How to get the private key from .pem file using JJWT

I have JJWT library integrated java project. And now I have a .PEM file which includes my RSA private key. How can I read the .PEM file and get the private key using JJWT library?
Randi
  • 639
  • 2
  • 6
  • 23
0
votes
0 answers

JWT verification using jjwt

I generated a RSA key using keytool. keytool -genkeypair -alias myAlias -keyalg RSA -dname ... creates a jks. I am using this to sign.. String sig = Jwts.builder().setClaims(claims).setIssuedAt(new …
Tester29
  • 3
  • 2
0
votes
1 answer

Decripting by JJWT a JSON String removed quotation marks -Java

My web site send a JWT (built in php) to a my app developped in Java. The JWT contains a JSON String inside a custom field called DATI. I use the library JJWT in order to decript the string contained inside DATI field: Claims MY_CLAIMS =…
Fausto70
  • 541
  • 5
  • 20
0
votes
1 answer

[JWT][JJWT] Function compact() very slow

I use lib JJWT 0.9.0 to generate Token. I have write log code segment generate Token, and I see function compact() run verry slow (664 -151 = 513(ms)) . how to the function compact() run faster or How to generate tokens faster? I use JDK7. My…
Hoang Vinh
  • 193
  • 1
  • 2
  • 11
0
votes
1 answer

@autowired for JwtBuilder class is not working, error: required a bean of type 'io.jsonwebtoken.JwtBuilder' that could not be found

I am trying to autowire the JJWT JwtBuilder which is imported from this package io.jsonwebtoken.JwtBuilder , however I am getting an error as shown below (at the end of the question) I have fixed a similar error when autowiring my own class by…
Ahmed Elkoussy
  • 8,162
  • 10
  • 60
  • 85
0
votes
0 answers

Adding a byte array in a JWT/JSON

Is it possible to add a byte array in a JWT's body? I get a stream of bytes from a source and I want to package it into a JWT and send it off. As a test, I tried converting a string to a byte array, added it to a jwt using the jjwt library, encoded…
nahzor
  • 460
  • 1
  • 4
  • 20
0
votes
1 answer

How to handle Auth token expiry situation without

I need one help related to Auth Token Expiry. I have one access token whose expiry is 30 minutes. As I am used doing something/some activity till 30 minutes . Now my token expired , at 30th minutes I called the service to fetch all users but at this…
rahulnikhare
  • 1,362
  • 1
  • 18
  • 25
0
votes
1 answer

Is required SecurityContextHolder in JWT Authentication App?

I'm developing application in Spring Boot and I need jwt authentication there. I decide to use that github project, but when I'm looking at code I don't understand sense of SecurityContextHolder. Here are 2 classes which are using…
Denis Stephanov
  • 4,563
  • 24
  • 78
  • 174