<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Authentication on JBoss AS 7.1 with WS-Policy
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/stedc">Stefano Stefano</a> in <i>JBoss AS 7 Development</i> - <a href="https://community.jboss.org/message/737740#737740">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p><strong>I have this simple webservice into my JBOSS AS 7.1.</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #333399; font-size: 10pt;">@javax.jws.WebService(</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; serviceName = "HelloWorldService",</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; portName = "HelloWorldPort",</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; targetNamespace = "<a class="jive-link-external-small" href="http://server.wssecurity.sogei.it/">http://server.wssecurity.sogei.it/</a>",</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; wsdlLocation = "WEB-INF/wsdl/hello-world.wsdl",</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; endpointInterface = "it.sogei.wssecurity.server.HelloWorld")</span><br/><span style="color: #333399; font-size: 10pt;">@EndpointConfig(configFile = "WEB-INF/<span style="color: #ff0000;">jaxws-endpoint-config.xml</span>", configName = "Custom WS-Security Endpoint")&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><br/><span style="color: #333399; font-size: 10pt;">public class HelloWorldImpl implements HelloWorld {</span></p><p><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160; private static final Logger LOG = Logger.getLogger(HelloWorldImpl.class.getName());</span></p><p><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160; /* (non-Javadoc)</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160; * @see it.sogei.wssecurity.server.HelloWorld#sayHello(java.lang.String&#160; arg0 )*</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160; */</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160; public java.lang.String sayHello(java.lang.String arg0) { </span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; LOG.info("Executing operation sayHello");</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(arg0);</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; try {</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; java.lang.String _return = "Hello " +arg0;</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return _return;</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; } catch (java.lang.Exception ex) {</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ex.printStackTrace();</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; throw new RuntimeException(ex);</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span><br/><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160; }</span></p><p><span style="color: #333399; font-size: 10pt;">}</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>My WSDL have this policy:</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #333399; font-size: 10pt;">&lt;wsp:Policy wsu:Id="UsernameToken"</span></p><p><span style="color: #333399; font-size: 10pt;"> xmlns:wsu="<a class="jive-link-external-small" href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd</a>"</span></p><p><span style="color: #333399; font-size: 10pt;"> xmlns:wsp="<a class="jive-link-external-small" href="http://www.w3.org/ns/ws-policy">http://www.w3.org/ns/ws-policy</a>" xmlns:sp="<a class="jive-link-external-small" href="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702</a>"&gt;</span></p><p><span style="color: #333399; font-size: 10pt;"> &lt;sp:SupportingTokens&gt;</span></p><p><span style="color: #333399; font-size: 10pt;">&#160; &lt;wsp:Policy&gt;</span></p><p><span style="color: #333399; font-size: 10pt;">&#160;&#160; &lt;sp:UsernameToken</span></p><p><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160; sp:IncludeToken="<a class="jive-link-external-small" href="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient</a>"&gt;</span></p><p><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160; &lt;wsp:Policy&gt;</span></p><p><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160;&#160; &lt;sp:WssUsernameToken10 /&gt;</span></p><p><span style="color: #333399; font-size: 10pt;">&#160;&#160;&#160; &lt;/wsp:Policy&gt;</span></p><p><span style="color: #333399; font-size: 10pt;">&#160;&#160; &lt;/sp:UsernameToken&gt;</span></p><p><span style="color: #333399; font-size: 10pt;">&#160; &lt;/wsp:Policy&gt;</span></p><p><span style="color: #333399; font-size: 10pt;"> &lt;/sp:SupportingTokens&gt;</span></p><p><span style="color: #333399; font-size: 10pt;">&lt;/wsp:Policy&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>How I can configure <span style="color: #ff0000;">jaxws-endpoint-config.xml </span>and <span style="color: #ff0000;">web.xml</span> for authenticating UsernameToken with JAAS ????</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"><strong> </strong>&#160;</p><p><strong>Thanks in advance</strong></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/737740#737740">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss AS 7 Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>