I have created a web service in my machine. Its URL is
http://localhost:8080/aaa/test?wsdl
I want to enable one feature to it. As soon as the user enters the url in browser, it should ask for the credentials. Can it be done in web services.
If yes, can some one guide how to achieve it.
Thanks.
If you’re already using Spring, you can easily apply basic authentication to a specific URL pattern with Spring Security. In your
applicationContext.xml, just add:Example taken from Mkyong’s Spring Security HTTP Basic Authentication Example.
If you’d like to lookup users in a database, you’d need to use a different authentication provider. The Spring Security reference mentions
data-source-refif you’d like to query the standard Spring Security user data tables. If you’ve already got your own structure, you might be interested in usinguser-service-refinstead, in which you can lookup the users yourself.And code
mypackage.MyUserDetailsServiceextending JdbcDaoImpl and implementingUserDetailsService.