You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a server that's accessed from the public network but also provides an API for a machine-to-machine communication. For this API there's no need for the JWT auth process, so ideally we would like to exclude these URLs from the authorization.
Describe the ideal solution
Another middleware that will be provide an easy and intuitive approach for excluding some URLs of the JWT auth process. For example something similar to the current error handler but maybe adapted a bit:
exlcusionUrlHandler := func(w http.ResponseWriter, r *http.Request) bool {
if isExclusionUrl(r.URL.String()) {
return true
}
return false
}
jwtmiddleware.New(
jwtmiddleware.WithExclusionUrl(exlcusionUrlHandler),
)
Alternatives and current workarounds
Currently we use the following approach to achieve this (not sure if it's the best way though):
Checklist
Describe the problem you'd like to have solved
We have a server that's accessed from the public network but also provides an API for a machine-to-machine communication. For this API there's no need for the JWT auth process, so ideally we would like to exclude these URLs from the authorization.
Describe the ideal solution
Another middleware that will be provide an easy and intuitive approach for excluding some URLs of the JWT auth process. For example something similar to the current error handler but maybe adapted a bit:
Alternatives and current workarounds
Currently we use the following approach to achieve this (not sure if it's the best way though):
Additional context
More than happy to provide a PR for this feature if you agree with the provided use case.
The text was updated successfully, but these errors were encountered: