Created
August 8, 2018 13:24
-
-
Save msinnema/c6581bbfbe77993fb8eb38d322512eb6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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