-
Notifications
You must be signed in to change notification settings - Fork 682
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
[Question] Auth middleware example #534
Comments
Hey,
|
Using v2, if the auth interceptor is added after the logging interceptor, no auth.sub is available in the default grpc server logs. Wouldn't it make sense if PostCall somehow had access to the context of previous handlers/middlewares? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, checking auth middleware example (https://github.com/grpc-ecosystem/go-grpc-middleware/tree/master/auth#L36) and have several questions:
grpc_ctxtags.Extract(ctx).Set("auth.sub", userClaimFromToken(tokenInfo))
// WARNING: in production define your own type to avoid context collisions
- do you suggest to define custom context type? but why? as i know it is a bad practiceThe text was updated successfully, but these errors were encountered: