Wednesday, April 25, 2012

Add basic authendication for Jetty

1. In web.xml, it needs to add this
This config indicates that all resources need ROLE api to access.

2. In the jetty folder, find start.ini and make sure the line like this is not commented. Of course to make this realm config right.
3. Go into your etc/jetty-example.xml to make the xml similar like this

          hw xxx Realm

4. Go into your etc/ file to set up realm configuration.

Also these two links are very helpful. Recently I found another problem with realm with jetty 8.1.7. When setup as above, the browser does not popup the authentication window but keep reporting error "This web page has a redirect loop" by Chrome. After a struggling by comparing the jetty xml files I found the issue was caused by this section in contenxts/test.xml


Just comment out this section, the issue was solved.

No comments:

Post a Comment