System.IdentityModel.Protocols.WSTrust specify BinarySecurityToken in RequestSecurityToken object

196 Views Asked by At

I'm trying to use WStrust built into .NET to make a SOAP request against an STS. The thing is that the STS wants a BinarySecurityToken with an arbitrary string put into the token.

Here's the .NET code I'm using:

RequestSecurityToken rst = new RequestSecurityToken
{ 
    RequestType = RequestTypes.Issue,
    OnBehalfOf(new SecurityToken()),  //what do I put here?
    AppliesTo = new EndpointReference(relyingPartyId),
    Issuer = new EndpointReference(issuerId),
    TokenType = "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0"
};

The STS wants the message to look like this:

<ns:OnBehalfOf>
  <ns:Base>
    <wss:BinarySecurityToken EncodingType="base64" ValueType="SOME_TYPE">
              ArbitraryString
    </wss:BinarySecurityToken>
  </ns:Base>
</ns:OnBehalfOf>

Does anyone know how I can construct a token so that it will be converted into that object by .NET? I need to specify SOME_TYPE and ArbitraryString...

0

There are 0 best solutions below