Questions tagged [jwt]

JSON Web Token (JWT, pronounced "jot") is an emerging type of token-based authentication used in space-constrained environments such as HTTP Authorization headers.

Filter by
Sorted by
Tagged with
0 votes
2 answers
66 views

Code that checks whether there is a holiday by calling another microservice

I call another microservice to check whether there is any holiday on any particular day. This will then add a comment in the db if the rest call doesn't fetch an empty list(a list of size 1). Here is ...
diaop's user avatar
  • 9
3 votes
0 answers
64 views

Building an API for an e-commerce system to allow third party software to import products

I am working on an e-commerce website called Shopless, which is similar to E-bay/Gumtree. Our website integrates with other DMS systems, in order to allow organisations to import products into our ...
Hooman Bahreini's user avatar
2 votes
2 answers
136 views

Decrypt incoming HTTP request headers

During each HTTP request incoming from my Angular front-end I send encrypted pair of access & refresh token. On the back-end ASP.NET web APIs are used. The way I decrypt them currently is by ...
Andrеw's user avatar
  • 21
2 votes
0 answers
1k views

Reactive JWT authentication using Spring webflux

Greeting to all senior devs here. I'm trying to create a project for my small business. There are not many tutorial on how to create Reactive JWT authentication with Spring webflux. So I'm a bit ...
Patrick's user avatar
  • 311
3 votes
1 answer
235 views

User registration and login service using JWT

I have created service to communicate with my backend for user registration and login. I use the JS fetch API and send all data through HTTPS. I use JWT tokens to authenticate queries once I have ...
ekke's user avatar
  • 133
1 vote
1 answer
71 views

Making my login function more readable and maintainable

I recently wrote a login function in my express application that does the following: Verifies the user's email and password are correct Generates a JWT Access Token with a short expiry date, and then ...
Tony's user avatar
  • 13
1 vote
0 answers
112 views

Signing in with "Remember me" option implemented with Spring and Kotlin

I'm trying to implement authentication with "Remember me" option using Spring and Kotlin. I would really appriciate if someone could help me find potential issues with that implementation as ...
Weeedooo's user avatar
2 votes
1 answer
81 views

PHP JWT management base library for inclusion in larger projects

Edit: this is a base library for including in larger projects for the overall management of JSON Web Tokens (JWT) that should be compatible with other JWT libraries that share an encryption secret - ...
BradChesney79's user avatar
1 vote
0 answers
385 views

Secure auth with Node.js, GraphQL, Nexus and passport with JWT's

I am trying to authenticate / authorise users with graphql, nexus, passport, prisma, graphql-shield and fastify for REST with JWT To answer possible questions: I am using passport because it handles ...
Daniell's user avatar
  • 11
2 votes
0 answers
177 views

ASP.Net Core WebAPI Authorization Policy for User or Admin [closed]

I have a controller that returns data about users. I want to set the authorization such that an admin can access this controller and retrieve data for any user, and a non-admin user can access the ...
Matt G's user avatar
  • 129
2 votes
1 answer
199 views

SSO login & authenticate Wordpress users with JWT token

I'm in the midst of exploring SSO with JWT & Wordpress, I'm not too sure if it's a good practice or does this setup/flow have any security vulnerabilities. Currently JWT/SSO method i'm using is ...
Mavichow's user avatar
  • 121
4 votes
0 answers
197 views

Get current user middleware from JWT using express

I'm using Sequelize and Google oAuth for authentication, I want to create a middleware that Verifies the sent token passed in the headers matches the one the user was initially signed to. Finds the ...
CarlosG90's user avatar
1 vote
1 answer
1k views

Expiring JWT tokens in Flask

I've been using flask-jwt-extended for my application and one of the problems I had was logging a session out and making sure the token is not usable anymore. I've ...
alecxe's user avatar
  • 17.2k
6 votes
1 answer
669 views

JWT Authentication Service

Recently I've built a service at my work to generate tokens with JWT (JSON Web Token) "protocol", I would like to show you the code and to get comments from you if that's good enough and if there are ...
Moshe Binieli's user avatar
3 votes
2 answers
2k views

JWT authentication between Django and ReactJS

I am currently using Django (2.1) to build an API, and I have added djangorestframework-jwt to manage JWT. Here is the configuration: ...
Baiello's user avatar
  • 33
2 votes
1 answer
1k views

Create annotation to validate JWT in Spring controller instead of filter

I developed a Spring RESTful service that uses a JWT for authorization. To the validity of this JWT, i used two different implementations. Create a filter to intercept every request and validate ...
benjamin c's user avatar
3 votes
0 answers
88 views

Implementing secure API for use between other internal apps

My team and I are trying to implement a secure API and would appreciate some feedback on the following: If there are areas of improvement in the current code to improve security Recommendations on ...
Kay E's user avatar
  • 31
3 votes
0 answers
76 views

JWT implementation in Crystal

I'm trying to learn Crystal. I made this to create a web token for authorization. I keep it updated on GitHub. Here is how I use it: ...
twharmon's user avatar
  • 303
10 votes
1 answer
6k views

Spring JWT authentication using cookies

I'm working on a experimental code which allows users to authorize using JWT's jjwt library. Here's what I have done so far on authentication and authorization flow....
benjamin c's user avatar
2 votes
1 answer
283 views

Json Web Token-like implementation in Rust

I am new to Rust. I am making this to help me learn better. This code has two functions: ::make() and ::get_payload(). ...
twharmon's user avatar
  • 303
1 vote
1 answer
407 views

Storing JWT in client side and putting tokens in all the future request

I have started using NodeJS with Express JS and PassportJS and JWT for User Authentication. I am able to authenticate the user and generate JWT Token. I am using Bootstrap for my front-end. By using ...
Rohith's user avatar
  • 71
1 vote
2 answers
393 views

JWT Authentication for REST API

Here is my code to implement authentication in a Node/Express/Sequelize project. This is my first time using JWT and I would appreciate any help! ...
Turtle's user avatar
  • 297
5 votes
1 answer
3k views

Generating public/private RSA key pair programmatically, using it for JWTs

In my app I'm using JSON Web Tokens for authentication purposes, using the pyjwt library. Instead of using static keys and/or worrying about key distribution, the server generates a public/private key ...
deceze's user avatar
  • 320
1 vote
0 answers
186 views

"RESTful" node.js server using express

I have attempted to construct a simple RESTful node server that allows for user authentication using passport and jwt: ...
finesse.png's user avatar
0 votes
1 answer
6k views

Simple login using ReactJS

I have successfully implemented a simple login page using ReactJS by coding it all in JavaScript (a flexibility that I like) but I am still a beginner in React and would like to know whether this is ...
WalidSabihi's user avatar
1 vote
2 answers
87 views

Logging in with multiple types of info

I'm trying to let users log in with multiple columns (e.g. ID, email, phone). If one fails, it checks the next column. I would like to minimise my if and ...
Jah's user avatar
  • 121
7 votes
1 answer
431 views

OAuth2 Implementation

I am trying to implement an OAuth2 service. I am not planning to use it anytime soon (like will write unit tests). This is my fun project I do to practice. I have used the python_jwt library to create ...
Maruf Maniruzzaman's user avatar
3 votes
0 answers
15k views

JWT - Simple API example

I have created this fake API just because I want to learn how to use JWT. It is a simple unsigned token exchange with two methods call: login and adminPassword. I've used https://github.com/lcobucci/...
Thom Thom Thom's user avatar
2 votes
0 answers
2k views

JWT with Firebase php-jwt

So my web app requires JWT authentication and I decided to make a mockup wrapper class for php-jwt before implementing it into my web app: ...
James Heald's user avatar
1 vote
1 answer
150 views

Generic JWT Handler

I'm developing a Go REST service that uses JWT (JSON Web Tokens) for authentication. I've written a JWTHandler which validates the token using a Validation Handler. If validation succeeds, the ...
W.K.S's user avatar
  • 512
3 votes
0 answers
3k views

Web API 2 - JWT with X509 certificate

I got my JWT generation working with X509 and wanted to ask if you would recommend any changes in respect to: Signing certificate storing / handling. Publishing for anonymous access public key ...
erPe's user avatar
  • 131
9 votes
1 answer
16k views

Authentication with JWT

Please review my code for 'JWT' authentication. Are there any security issues? Where should I store the secret's key, DB or InMemory? What's a good 'JWT' Lifetime? Should I send the 'JWT' in Header ...
Rue Ryuzaki's user avatar
14 votes
1 answer
28k views

Web API 2 authentication with JWT

Please review my code for bearer token (JWT) authentication of Web API 2 (Self Hosted using OWIN) Are there any security issues in the implementation? Quick overview: Token creation and validation ...
Narayana's user avatar
  • 713