The basics of Micronaut security
For handling any security aspects, the Micronaut framework has a built-in SecurityFilter
object. The SecurityFilter
object intercepts any incoming HTTP requests and kickstarts the authentication/authorization process as configured in the application. In the following diagram, you can see the workflow within the SecurityFilter
object for authorizing a user request:
Micronaut's SecurityFilter
has three essential parts:
- AuthenticationFetcher:
AuthenticationFetcher
will fetch the required downstream authenticator for authenticating the user request. - Authenticator:
Authenticator
injects the configured authentication provider(s) and security configurations for authenticating the user request. AnAuthenticationResponse
object is created based on the success or failure of the auth operation. - SecurityRule: If auth is successful, then the security filter will further invoke...