I am a beginner and recently started understanding JAAS. Is there a way to get the Subjects IP Address in the login() method.
My objective is to perform IP Filtering for my server.
JAAS is for Authentication and Authorization. IP Filtering is more fit to a firewall, most likely you don't want to handle it in your application. But to answer your question directly: you can't do this with JAAS.
As the previous answer stated you can't do this with JAAS and should ideally do this in a firewall outside the application.
If you absolutely must do this in the application anyway then you can use JASPIC for this. It's the Java EE authentication mechanism and it allows full access to the http request and response.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With