Comments (14)
Russian needs too :)
from jwt.
I found temporary workaround for AzureAD.
import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { JwksClient } from 'jwks-rsa';
import * as jwt from 'jsonwebtoken';
@Module({
imports: [
JwtModule.registerAsync({
async useFactory() {
const client = new JwksClient({
cache: true,
rateLimit: true,
jwksRequestsPerMinute: 5,
jwksUri: `https://login.microsoftonline.com/common/discovery/keys`,
});
const keys = await client.getSigningKeys();
return {
secretOrKeyProvider(requestType, token: string) {
const decoded = jwt.decode(token, { complete: true });
return keys
.find((key) => key.kid === decoded.header.kid)
.getPublicKey();
},
verifyOptions: {
audience: '(client id)',
issuer:
'https://login.microsoftonline.com/(tenant id}/v2.0',
algorithms: ['RS256'],
},
};
},
}),
],
})
export class AuthModule {}
from jwt.
Hey, any updates with this issue?
from jwt.
i need this feature too. I think with the package passport-jwt we can use this feature already
from jwt.
Hi, from Japan.
I'm also looking forward to this feature!
from jwt.
Would you like to create a PR for this issue?
from jwt.
Sure! If you think it makes sense I can work on a PR :)
from jwt.
That would be great!
from jwt.
Hi @rafaelcorreiapoli , any update on the PR for this one?
from jwt.
@iamsuneeth Sorry I could not advance with the PR.
from jwt.
Hi, any updates on supporting JWKS URI as secretOrKeyProvider
from jwt.
Please 🙏
from jwt.
I've updated #469 in #1486 to resolve conflicts and typos as the proposed workaround only fetches keys on boot which isn't suitable to handle key rotations.
from jwt.
Let's track this here #1486
from jwt.
Related Issues (20)
- sign function dosent take secret registred in module HOT 1
- secretOrPrivateKey must have a value HOT 3
- jwt module shoud extends ConfigurableModuleClass HOT 1
- Wrong dependency @types/jsonwebtoken HOT 1
- vulnerability in dependancy jsonwebtoken <=8.5.1 HOT 1
- Updating `jsonwebtoken` dependency HOT 3
- Update `@types/jsonwebtoken` to ^9.0.0 HOT 2
- secretOrPrivateKey must have a value HOT 1
- secretOrPrivateKey has a minimum key size of 2048 bits for RS256 after upgrade to nest/jwt 10.0.2 HOT 1
- How to invalidate a token? HOT 2
- BigInt not supported HOT 1
- type error while using `expiresIn` in `signAsync` HOT 7
- Expose internal Jsonwebtoken errors from @Next/jwt HOT 1
- Issue: Missing 'requestProperty' in @nestjs/jwt Library HOT 1
- JsonWebTokenError: secretOrPublicKey must be an asymmetric key when using RS256 HOT 1
- Error: secretOrPrivateKey must have a value HOT 1
- No valid invalid token for verification HOT 2
- wrong signature for sign() HOT 1
- Unexpected behavior when getting a value from .env file for expiresIn property via the ConfigModule / ConfigService HOT 1
- Can not import JwtService, JwtModule after installed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jwt.