Ajit Singh
Ajit Singh

Reputation: 75

Get the Subjects IP Address in JAAS

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.

Upvotes: 4

Views: 256

Answers (2)

Mike Braun
Mike Braun

Reputation: 3769

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.

Upvotes: 1

meskobalazs
meskobalazs

Reputation: 16041

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.

Upvotes: 5

Related Questions