Question

How can I make Grizzly HTTP server allow JaaS for simple HTTP AUTH? I can't see any code/sample out there: There's another post here in StackOverflow that directly assumes that jaaS is available in Grizzly, but doesn't explain how to add it.

Was it helpful?

Solution

I don't think the Grizzly HTTP server provides basic auth 'out of the box'. If you do not want to use a full-blown implementation like glassfish, you can implement your own filter and add it to the list of grizzly filters. Here is an example of how to extract the login data via HTTP basic auth and how to integrate it in JAAS objects within the grizzly context. But it requires a significant amount of coding.

http://java.net/projects/jersey/sources/svn/content/trunk/jersey/samples/https-clientserver-grizzly/src/main/java/com/sun/jersey/samples/https_grizzly/auth/SecurityFilter.java?rev=5160

Hope that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top