Skip to content

Tag Archives: authentication

Securing Webservices using BASIC Authentication on Weblogic Server.

04-Jan-10

To secure the Webservice to use Basic Authentication, we just need to use the @RolesAllowed annotation. No change needs to be done in the deployment descriptor. Here is a sample JWS. package demo; import javax.jws.*; import weblogic.jws.security.RolesAllowed;import weblogic.jws.security.SecurityRole; @RolesAllowed ( { @SecurityRole (role=”Adminstrators”,mapToPrincipals{“weblogic”}),}) @WebServicepublic class TestBasic { @WebMethodpublic void hello(String test) {System.out.println(“print”+test);}}