-
Notifications
You must be signed in to change notification settings - Fork 22
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
Support for security configuration #3
Comments
Hi @dsyer |
If you wait for the interceptor support it will probably make it easier. I think the general idea is to create an interceptor that calls out to Spring Security. You can see the existing implementations at https://github.com/LogNet/grpc-spring-boot-starter and https://github.com/grpc-ecosystem/grpc-spring. |
Until the interceptor support is officially added (should be in the next couple days), you can register a |
Got a small example.
@onobc What do you think? Good direction? |
Hi @CyberZujo , the above does look like an empty interceptor impl that could be used to hook into security. Although, you can also use a The delicate work here will be figuring out exactly what/how we want to hook into Spring Security. From the examples given by @dsyer above, we can see both the gRPC ecosystem starter (here) and the Lognet starter (here) both have quite a bit of security components. My suggestion would be to first digest each of these and summarize what they do/not cover and from that we can decide which direction to go. Another option would be to just move the gRPC ecosystem security components directly in. @dsyer wdyt? |
Definitely use |
If the token-based auth is sufficient then going w/ a single simpler thing for v1 would be a great idea IMO. |
If you both agree, I would like this one assigned to me, for token-based auth approach.
I'll come back with some example of using JWT token. |
I think there should already be an interceptor that does this (and on the client). Check the grpc-java source code. |
That wasn't what I meant. Try starting here: https://github.com/grpc/grpc-java/blob/master/auth/ and https://github.com/grpc/grpc-java/blob/master/authz |
Got it, sorry. Will proceed with that approach. |
I also noticed that JWT is only supported through a sample (https://github.com/grpc/grpc-java/blob/master/examples/example-jwt-auth). Maybe a Spring Security interceptor wouldn't be such a bad idea? The JWT sample is probably a good starting point anyway. |
Ideally, one would just add the |
That could work. The dependency on spring-web and/or the servlet API might mess things up. |
That's correct, the resource-server starter 's configuration classes are dependent on the Servlet web-application type. I usually copy the content of |
I started work on a security interceptor: https://github.com/dsyer/spring-grpc/tree/secure. It's quite tough going, but we probably don't need a lot of features to start with. |
No description provided.
The text was updated successfully, but these errors were encountered: