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

Springboot Method Level Security not working with GRPC #50

Closed
binaradarsha opened this issue Sep 2, 2017 · 5 comments
Closed

Springboot Method Level Security not working with GRPC #50

binaradarsha opened this issue Sep 2, 2017 · 5 comments

Comments

@binaradarsha
Copy link

binaradarsha commented Sep 2, 2017

I setup a Springboot (SSL) application with GRPC, including few REST controllers too.
Method Level Security not working in GRPC controllers, neither inside invoked service layer and jpa layer methods too.
Still works well in REST controllers.

Status{code=UNKNOWN, description=null, cause=null} is retrieved when invoke a GRPC service method with @PreAuthorize("hasAuthority('ROLE')"). I checked with debug that SecurityContextHolder does not have an Authentication object.

In maven pom.xml, dependencies are presented as below.

        <groupId>net.devh</groupId>
        <artifactId>grpc-server-spring-boot-starter</artifactId>
        <version>1.2.0.RELEASE</version>
        <groupId>net.devh</groupId>
        <artifactId>grpc-client-spring-boot-starter</artifactId>
        <version>1.2.0.RELEASE</version>

Is this a configuration issue with this dependency, or seems I am missing something?

Should I do some JWK configuration?

@ST-DDT
Copy link
Collaborator

ST-DDT commented Oct 18, 2018

For me the following worked:

@ST-DDT
Copy link
Collaborator

ST-DDT commented Oct 18, 2018

@binaradarsha
Copy link
Author

Hi, thanks for comments, I will check on them.

@ST-DDT
Copy link
Collaborator

ST-DDT commented Oct 20, 2018

If all goes well I might be able to PR some more features such as Security auto configuration to this project. Since that is work related I have to check with the company first.

@ST-DDT
Copy link
Collaborator

ST-DDT commented Oct 22, 2018

@yidongnan Would you merge a corresponding contribution (from me), or do you want to keep the library as slim as possible?

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