-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose access-token-jwt
library, so this package could be used without express
#75
Comments
access-token-jwt
libraryaccess-token-jwt
library, so this package could be used without express
Until this issue is resolved I extracted and published it as auth0-access-token-jwt |
Hi @markelog - thanks for your interest in this. You are of course welcome to fork and publish your own versions of this code, I would only kindly ask that you don't include "auth0" in the name. Regarding publishing this, we do hope to extend this to more frameworks either through a framework agnostic package or through more framework specific packages. Will close this in favour of #63 |
Gotta say, as a paying customer, I am quite disappointed with your community work 😢. Since you are expressing this hope in at least three other issues like it.
it has How would you propose for me to call it? |
I'm really sorry you feel that way @markelog - we're a relatively small team of SDK engineers with a large surface area of SDKs to support and have to make hard decisions about what to support. We are grateful for the feedback though.
Auth0 has no control over what goes into your |
I have the same need today, the Guard in the guidelines doesn't work with the SocketIO gateway in NestJS. |
Respectfully, this is a strong argument in FAVOR of publishing it. The linked ticket is 2 years old now. You're never going to get to all of the frameworks, and even if you did, plenty of use cases don't use any framework at all. This isn't some component library, it's security. I want to use an official package from the auth provider, not some third party module. But at any rate, rather than republishing, here's a bit of middleware abuse to expose the same interface as import { auth, type AuthOptions, type AuthResult, type JWTPayload, UnauthorizedError } from 'express-oauth2-jwt-bearer'
export const jwtVerifier = (config?: Omit<AuthOptions, 'authRequired'>) => {
const middleware = auth(config)
return (accessToken?: string): Promise<AuthResult> => {
return new Promise((resolve, reject) => {
const request = {
query: { access_token: accessToken },
headers: {},
is: () => false,
auth: undefined as unknown as AuthResult,
}
middleware(request as any, {} as any, (error: unknown) => {
error ? reject(error) : resolve(request.auth)
})
})
}
} Which can be used like: const verifyJwt = jwtVerifier({
issuerBaseURL: 'https://example.com',
audience: 'https://example.com/api',
})
try {
const authResult = await verifyJwt('abcd1234')
} catch (error) {
console.error(error)
} |
Describe the problem you'd like to have solved
In my project I use nodejs but do not use the express, would it be possible for you to export or publish the
access-token-jwt
as a separate entity?Thank you
The text was updated successfully, but these errors were encountered: