Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

En token til SBO kan hentes fra SOSI Gateway på nedenstående måde. Det forudsættes at der er logget på SOSI Gateway og dermed er assertion initieret.
Endpoint refererer til STS og ClientVia refererer til SOSI Gateway.
using (var stsClient = new Seal2SamlStsClient("GWFetchCard"))
using (var scope = new OperationContextScope((IContextChannel)stsClient.Channel.Channel))
{
var factory = CreateFactory();
OperationContext.Current.OutgoingMessageHeaders.Add(new IdCardMessageHeader( factory.DeserializeIdCard(assertion)));
var d = stsClient.ExchangeAssertionViaGW( "http://sundhed.dk/") as GenericXmlSecurityToken;
var elm = d.TokenXml;
}
Konfiguration:<endpoint address="http://test1.ekstern-test.nspop.dk:8080/sts/services/Sosi2OIOSaml"
binding="customBinding"
behaviorConfiguration="AddressingBehavior"
bindingConfiguration="Soap11Http"
contract="System.ServiceModel.Security.IWSTrustChannelContract"
name="GWFetchCard" />
<customBinding>
<binding name="Soap11Http">
<textMessageEncoding messageVersion="Soap11WSAddressing10" writeEncoding="utf-8" />
<httpTransport />
</binding>
</customBinding>
<behavior name="AddressingBehavior">
<clientVia viaUri="http://test2.ekstern-test.nspop.dk:8080/sosigw/proxy/soap-request"/>
</behavior>


<configuration>
    <system.serviceModel>
        <bindings>
            <customBinding>
                <bindingname="Soap11Http">
                    <textMessageEncodingmessageVersion="Soap11"writeEncoding="utf-8" />
                    <httpTransport />  <!-- If client certificate is required, use '<httpsTransport requireClientCertificate="true" />' instead, -->
                </binding>
            </customBinding>
        </bindings>
        <client>
            <endpoint
            address="http://test1.ekstern-test.nspop.dk:8080/sts/services/Sosi2OIOSam"
            behaviorConfiguration="AddressingBehavior"
            binding="customBinding"
            bindingConfiguration="Soap11Http"
            contract="System.ServiceModel.Security.IWSTrustChannelContract"
            name="GWFetchCard"
            />
        </client>
        <behaviors>
            <endpointBehaviors>
                <behaviorname="AddressingBehavior">
                    <clientViaviaUri="http://test2.ekstern-test.nspop.dk:8080/sosigw/proxy/soap-request" />
                    <clientCredentials>
                        <clientCertificatefindValue="21ad7d2d4280765bfe113b7dd5d62736c34e37bd"storeLocation="LocalMachine"storeName="My"x509FindType="FindByThumbprint" />
                    </clientCredentials>
                    <SealBehaviorBE />
                </behavior>
            </endpointBehaviors>
        </behaviors>
        <extensions>
            <behaviorExtensions>
                <addname="SealBehaviorBE"type="dk.nsi.seal.DccSealBehaviorExtentionElement, Seal" />
            </behaviorExtensions>
        </extensions>
    </system.serviceModel>
</configuration>



Anchor
_Toc487881363
_Toc487881363
Anchor
_Toc342300599
_Toc342300599
Eksempler ved brug af OioSamlFactory

...