Questions tagged [json-web-token]

JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties.

JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JavaScript Object Notation (JSON) object that is used as the payload of a JSON Web Signature (JWS) structure or as the plaintext of a JSON Web Encryption (JWE) structure, enabling the claims to be digitally signed or MACed and/or encrypted.

The suggested pronunciation of JWT is the same as the English word "jot".

Source

243 questions
3
votes
1 answer

Retrieving Azure AD Group information with JWT

I have APIs that require Azure AD bearer authentication. public void ConfigureAuth(IAppBuilder app) { app.UseWindowsAzureActiveDirectoryBearerAuthentication( new WindowsAzureActiveDirectoryBearerAuthenticationOptions { //…
3
votes
2 answers

How to invalidate user session on inactivity in a stateless server?

I'm building a stateless RESTful server backend in Java, that will be used by an AngularJS frontend. Since it should be stateless, I don't create sessions but generate access tokens, more precisely JSON web tokens, the client has to present on every…
Tim Büthe
  • 62,884
  • 17
  • 92
  • 129
2
votes
0 answers

Refresh token in Angular interceptor if it is expired

I've implemented this logic in Angular interceptor to intercept all the requests and inject Authorization header. It also catches all the 401 Unauthorized responses and in this case tries to refresh the token first, then retries the original…
Sfisioza
  • 3,830
  • 6
  • 42
  • 57
2
votes
0 answers

Firebase ID token from client App gives Exception on Java backend verification

I've just started using Firebase. React app + Java backend. React side authorization works well however when I send user's id token to backend and try to verify is using firebase library I get an exception. I took all code from documentation. in js…
2
votes
1 answer

Tymon JWTAuth for custom model which is not user model

I want to create JWT using client model. All the login credentials are saved in the clients table. Here in my Laravel 5.4 application I dont want to have users model. My piece of code is being showing. Now when I am trying to login laravel querying…
Arunava
  • 81
  • 1
  • 1
  • 5
2
votes
1 answer

jsonwebtoken Typescript Compiling issue?

I'm trying to compile a typescript file and it keeps throwing this error from the compiler: error TS2339: Property 'payload' does not exist on type 'string | object'. Property 'payload' does not exist on type 'string'. Code in…
R.A. Lucas
  • 1,121
  • 1
  • 12
  • 17
2
votes
1 answer

nodejs jsonwebtoken with PEM file: error "PEM_read_bio:no start line"

I know there are a bunch of similar questions here but after hours of reading I cannot find a solution to mine. So: I am trying to use jwk-to-pem for signing a JSON web token using jsonwebtoken. I have previously achieved this but now the same code…
B M
  • 3,893
  • 3
  • 33
  • 47
2
votes
2 answers

Class 'Illuminate\Foundation\Auth\User' not found JWT Auth Laravel

I have written code for registration and login using JWT authentication. In this code registration function works fine but login function doesn't works. Login function prompts an error as Class 'Illuminate\Foundation\Auth\User' not found My user…
Muthu
  • 189
  • 3
  • 7
  • 18
2
votes
1 answer

Node JS Authentications with passport-jwt unauthorized

Im trying to setup my Node JS API. I have a User model : // Dependencies var restful = require('node-restful'); var mongoose = restful.mongoose; var bcrypt = require('bcrypt'); // Schema var userSchema = new mongoose.Schema({ username: { …
2
votes
0 answers

how to auth the JWT in android

Im really new in android. I have the HTTP Headers: "Authorization":…
Armando82
  • 21
  • 1
2
votes
2 answers

Python Post Requests to HTTP RestAPI with JwToken authentication generates duplicate posts

I've been writing a API procedure to test posting to an http RestAPI with JwToken authentication. In this scenario it's for patient management system and I'm generating an appointment. The API business rule does not allow duplicate bookings for the…
Roochiedoor
  • 887
  • 12
  • 19
2
votes
2 answers

Laravel or Lumen JWT remove default claims

I'm using Tymon's JWTAuth to connect the app to the api in stateless manner thru tokens. But the problem is that when I decode the token, on the payload data, the iss value is the API url itself. How to change the value remove the key from being…
basagabi
  • 4,900
  • 6
  • 38
  • 84
2
votes
1 answer

The string to be decoded is not correctly encoded, Encoding done by JsonWebtoken

which way is the correct one for decoding tokens in the client side that are encoded using the node jsonwebtoken module, this is how am creating the token let token = jwt.sign({ my_data: data, exp: parseInt(expiry.getTime() / 1000) },…
Thabo
  • 1,303
  • 2
  • 19
  • 40
2
votes
0 answers

Ionic 2 - How to use refresh token to obtain new JWT

I have an ionic 2 mobile application that uses Json Web Tokens(JWT) to authenticate to various routes on a node.js API. These JWTs have a short expire time, and need to be refreshed using a refresh token. The refresh token is just a random string…
Marco Orlando
  • 70
  • 2
  • 8
2
votes
1 answer

Using Json Web Tokens with Flask-Oauthlib

For a client project I am developing a web app that is using Flask for the backend. So I decided to use Flask-oauthlib in a attempt to make supplying refresh tokens, and revoking access tokens simple. However, there is something I am still having a…