How to get the username and password when create my own STS via WIF

812 Views Asked by At

I'm using WIF to build a custom STS. After inherited the SecurityTokenService class, I hosted my STS as a WCF service by using the WSTrustServiceHost and IWSTrust13SyncContract. And since it's just a prototype STS I was using BasicHttpBinding.

On the client side I used the WSTrustChannelFactory to connect to my STS and I can get the output claims successfully.

But when I tried to add the authentication information (username and password) I found that it cannot be passed into my STS.

1, If I was using BasicHttpBinding I cannot find the username and password on STS even though I specified them through the client side factory.Credentials.UserName.UserName and .Password.

2, I changed to use UserNameWSTrustBinding(SecurityMode.Transport) but I still cannot get the username and password in STS.

3, In STS the parameter of the methods GetScope, GetOutputClaimsIdentity are the principal that I run the server console application, instead of the one that I specified from the client side.

4, I registered another UserNameSecurityTokenHandler and overrided its ValidateToken method. But it seems that the STS did NOT invoke this method. And the STS raised an exception said there's no CreateToken implementation.

5, I tried the build-in WindowsUserNameTokenHandler it also raised the same exception.

Can anybody have a look and give me some suggestion on how to deal with.

0

There are 0 best solutions below