Skip to content
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

Is it possible to use this middleware with two different token issuers ? #283

Open
gipsh opened this issue Nov 14, 2021 · 2 comments
Open

Comments

@gipsh
Copy link

gipsh commented Nov 14, 2021

Hi, i have been using the library for my api succesfully, now i want also support tokens issued by another platform (azure AD).
So i need to check if the signature of the token is valid for my own issued tokens AND from the other platform.

Is there an easy way to support this?

i already tried using two middlewares to validate with no luck

	apiv1.Use(authMiddleware.MiddlewareFunc(), externalTokenValidator.MiddlewareFunc()) {

       .....

       }

What the best strategy here? create a new middleware and check azure signature there and then call gin-jwt middleware?

Sorry if the question is off-topic.

@gu-hy
Copy link

gu-hy commented Oct 6, 2023

Hello, are there any updates on this matter?

What could be the best approach to use multiple instances of gin-jwt as middleware (or gin-jwt + additional auth middleware) and chain it properly (if its possible)?

@gipsh
Copy link
Author

gipsh commented Oct 6, 2023

@gu-hy what i ended up doing was creating a special endpoint where you submit the token from the other provider and after checks and validations it returns a valid token from the current provider. Not the best but worked for my use case albeit it required more work for ui.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants