Announcement Announcement Module
Collapse
No announcement yet.
authentication in soap header Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • authentication in soap header

    Hi

    Im using soapUI to test my webservice and in the soap header i have added the following snippet :

    <soapenv:Header>
    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
    soapenv:mustUnderstand="1">
    <wsse:UsernameToken>
    <wsse:Username>mmt</wsse:Username>
    <wsse:Password>mmt</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soapenv:Header>


    I am handling the authentication using the SimplePasswordValidationCallbackHandler

    but when i submit my request,im getting the following error message :

    "The security token could not be authenticated or authorized; nested exception is org.apache.ws.security.WSSecurityException: The security token could not be authenticated or authorized"

    How do i resolve this issue...pls help...??
    Please tell me if im missing something in what i have done so far...??

  • #2
    The security header you added doesn't seem to be valid. How did you generate it? You can use SoapUI to add valid WS-Security headers to your requests.

    Comment


    • #3
      UserNameToken Header

      Had the same problem. Created a header with soapUI.

      Unfortunately I am only allowed to post URLs to other sites after a have made 15 posts or more.

      So I replaced http colon slash slash with HTTP

      <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="HTTPdocs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <wsse:UsernameToken wsu:Id="UsernameToken-27777511" xmlns:wsu="HTTPdocs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
      <wsse:Username>Bert</wsse:Username>
      <wsse:Password Type="HTTPdocs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Ernie</wsse:Password>
      </wsse:UsernameToken>
      </wsse:Security>

      The password type attribute solved the problem.

      Comment


      • #4
        Originally posted by pedanen View Post
        Had the same problem. Created a header with soapUI.

        Unfortunately I am only allowed to post URLs to other sites after a have made 15 posts or more.

        So I replaced http colon slash slash with HTTP

        <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="HTTPdocs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
        <wsse:UsernameToken wsu:Id="UsernameToken-27777511" xmlns:wsu="HTTPdocs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <wsse:Username>Bert</wsse:Username>
        <wsse:Password Type="HTTPdocs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Ernie</wsse:Password>
        </wsse:UsernameToken>
        </wsse:Security>

        The password type attribute solved the problem.
        ya.....i also found out the problem to be the password type while debugging the source code.......thanks for the reply though

        Comment

        Working...
        X