Skip to content

Instantly share code, notes, and snippets.

@msinnema
Created August 8, 2018 13:24
Show Gist options
  • Save msinnema/c6581bbfbe77993fb8eb38d322512eb6 to your computer and use it in GitHub Desktop.
Save msinnema/c6581bbfbe77993fb8eb38d322512eb6 to your computer and use it in GitHub Desktop.
// SecurityMode.Transport enables HTTPS
var binding = new WSHttpBinding(SecurityMode.Transport)
{
Security =
{
Mode = SecurityMode.Transport,
Message = {ClientCredentialType = MessageCredentialType.None},
Transport =
{
ClientCredentialType = HttpClientCredentialType.InheritedFromHost,
ProxyCredentialType = HttpProxyCredentialTYpe.None,
Realm = string.Empty
}
}
};
// Enable authentication
var passageServiceClient = new PassageServiceClient(
binding,
new EndpointAddress("https://[SYNERGY URL]/PassageService")
);
// Add credentials
passageServiceClient.ClientCredentials.UserName = "[USERNAME]";
passageServiceClient.ClientCredentials.Password = "[PASSWORD]";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment