Comments (7)
We have a section in the guide: https://micronaut-projects.github.io/micronaut-security/latest/guide/#securityService
from micronaut-security.
you can inject a bean of type SecurityService
from micronaut-security.
I tried to inject SecurityService, but getAuthentication returns empty.
from micronaut-security.
do you have sample which reproduces your issue?
from micronaut-security.
I will prepare the sample and will share, and I traced down and the reason that ServerRequestContext return empty requst.
I tried to use ServerRequestContext directly and it return empty "ServerRequestContext.currentRequest".
Update:
The PropagatedContext was cleared before reaching the event listner, this is why ServerRequestContext.currentRequest is empty.
from micronaut-security.
@heshamz I have done some testing to try and reproduce this on my own, and my conclusion without seeing a provided sample here is that this is likely similar to the behavior seen in the reproducible sample in #1468. In other words, the issue is likely due to switching between different reactive contexts and not supplying the necessary plumbing for the Context Propagation that is new in Micronaut 4. See my explanation there for some further detail.
As in that case, it is possible that adding the Micrometer Context Propagation dependency could fix your scenario, though I can't say for certain without knowing more details of your exact setup.
from micronaut-security.
We added a doc mention. @heshamz please reopen if adding Micrometer context propagation does not fix your issue.
from micronaut-security.
Related Issues (20)
- JWTs for Client Authentication
- Token Propagation and OpenID "azp" claim validation issues HOT 3
- Unable to login via a form HOT 2
- Micronaut 4 non-documented breaking changes
- Micronaut 4 upgrade document does not mention about the breaking changes of Micronaut Security HOT 2
- custom role claims in Id/Access tokens are missing in Micronaut generated JWTs HOT 3
- security-processor module HOT 2
- Non-reactive TokenValidator HOT 4
- Update JWT Authentication guide to don't use deprecated APIs HOT 1
- OAuth2 flow Authorization Token is duplicated when Retry occurs with Rxjava HOT 9
- Add locale and host to Micronaut security events
- Docs: Token Propagation requires io.micrometer:context-propagation HOT 1
- ReadTimeoutException loading JWK causing exponential resource consumption since 4.5.0 HOT 9
- `file:` prefix is not working for static jwks configurations
- JwksSignature error when used from HttpServerFilter HOT 3
- Session based authentication doesn't work with Micronaut framework version 4.3.8 or later HOT 3
- Since Micronaut Security 4.6.8 route match is randomly null in the SecurityFilter HOT 32
- Micronaut 4.x.x ResponseClosedException happend at OAuth 2.0 HOT 1
- Cusom Secured-based annotations don't work HOT 4
- Multiple @CreatedBy does not register authenticated user in database
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micronaut-security.