[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Matt Mannion

1/6/2003 4:32:00 PM

I am trying to build a simple sample webservice and
client that will pass a username and password in the SOAP
header.

My sample works fine if I pass only the username, but if
I try to pass the password, I get an exception:
Microsoft.Web.Services.Security.SecurityFault:
The security token could not be authenticated or
authorized.

Any ideas on what the problem is?
Thanks in advance.

Matt
4 Answers

Scott Swigart

1/6/2003 6:25:00 PM

0

On the server side, you have to create a class that implements the
IPasswordProvider interface, and you have to register this class in your
web.config file.

Here's what happens. When the server receives a username token, then it
instantiates your class on the server, calls the GetPassword method, and
passes in the user name. If the password that you return matches the
password in the message, then the user is authenticated. Otherwise, the
user is not.

HTH,
Scott Swigart
www.3leaf.com
Early Adopter Weblog: http://radio.weblogs.co...

"Matt" <mmannion@claritycon.com> wrote in message
news:059301c2b598$d3e8c8e0$8df82ecf@TK2MSFTNGXA02...
> I am trying to build a simple sample webservice and
> client that will pass a username and password in the SOAP
> header.
>
> My sample works fine if I pass only the username, but if
> I try to pass the password, I get an exception:
> Microsoft.Web.Services.Security.SecurityFault:
> The security token could not be authenticated or
> authorized.
>
> Any ideas on what the problem is?
> Thanks in advance.
>
> Matt


Matt Mannion

1/6/2003 6:53:00 PM

0

Scott,

Thanks for your reply, my sample already implemented the
IPasswordProvider interface and the web.config file was
configured correctly.

The piece I had wrong was the password returned from the
GetPassword method did NOT match the password I used when
the client instantiated the UsernameToken class (my
mistake).

I changed my code so the passwords would match and the
sample works great!

Thanks for your help.

Matt
>-----Original Message-----
>On the server side, you have to create a class that
implements the
>IPasswordProvider interface, and you have to register
this class in your
>web.config file.
>
>Here's what happens. When the server receives a
username token, then it
>instantiates your class on the server, calls the
GetPassword method, and
>passes in the user name. If the password that you
return matches the
>password in the message, then the user is
authenticated. Otherwise, the
>user is not.
>
>HTH,
>Scott Swigart
>www.3leaf.com
>Early Adopter Weblog: http://radio.weblogs.co...
>
>"Matt" <mmannion@claritycon.com> wrote in message
>news:059301c2b598$d3e8c8e0$8df82ecf@TK2MSFTNGXA02...
>> I am trying to build a simple sample webservice and
>> client that will pass a username and password in the
SOAP
>> header.
>>
>> My sample works fine if I pass only the username, but
if
>> I try to pass the password, I get an exception:
>> Microsoft.Web.Services.Security.SecurityFault:
>> The security token could not be authenticated or
>> authorized.
>>
>> Any ideas on what the problem is?
>> Thanks in advance.
>>
>> Matt
>
>
>.
>

(hodge)

1/6/2003 11:06:00 PM

0

"Matt" <mmannion@claritycon.com> wrote in message news:<059301c2b598$d3e8c8e0$8df82ecf@TK2MSFTNGXA02>...
> I am trying to build a simple sample webservice and
> client that will pass a username and password in the SOAP
> header.
>
> My sample works fine if I pass only the username, but if
> I try to pass the password, I get an exception:
> Microsoft.Web.Services.Security.SecurityFault:
> The security token could not be authenticated or
> authorized.
>
> Any ideas on what the problem is?
> Thanks in advance.
>
> Matt

I'm having the same problem. I posted a message a week ago, and I
never received a response. Someone at MS, please help!

Matt Mannion

1/8/2003 12:23:00 AM

0

Hodge,

Did you see the message I posted under Scott's reply to
my message? The problem I was having was an error on my
part. I failed to return the the exact same password
from the IPasswordProvider.GetPassword method as I used
in my client when I instantiated the UsernameToken class.

To test is out, you can use the same simple string in
both the client and the web service.
IPasswordProvider.GetPassword can be one line of code
that returns just the simple string. Once you get it
working with a simple hard-coded string, you can add more
complex logic to derive the password to return.

HTH,
Matt
>-----Original Message-----
>"Matt" <mmannion@claritycon.com> wrote in message
news:<059301c2b598$d3e8c8e0$8df82ecf@TK2MSFTNGXA02>...
>> I am trying to build a simple sample webservice and
>> client that will pass a username and password in the
SOAP
>> header.
>>
>> My sample works fine if I pass only the username, but
if
>> I try to pass the password, I get an exception:
>> Microsoft.Web.Services.Security.SecurityFault:
>> The security token could not be authenticated or
>> authorized.
>>
>> Any ideas on what the problem is?
>> Thanks in advance.
>>
>> Matt
>
>I'm having the same problem. I posted a message a week
ago, and I
>never received a response. Someone at MS, please help!
>.
>