From client I request for token via WSTrustChannelFactory.
var binding = new UserNameWSTrustBinding(SecurityMode.TransportWithMessageCredential);
var factory = new WSTrustChannelFactory(binding, IDPAddress);
//set up credetials
factory.Credentials.UserName.UserName = "xxx";
factory.Credentials.UserName.Password = "xxx123";
factory.TrustVersion = TrustVersion.WSTrust13;
//create token request
var rst = new RequestSecurityToken
{
RequestType = RequestTypes.Issue,
KeyType = KeyTypes.Symmetric,
AppliesTo = new EndpointReference(ServiceAddress.AbsoluteUri)
};
return factory.CreateChannel().Issue(rst);
When I call Issue method I get error:
{"The requested service, 'https://domain:9988/issue/wstrust/mixed/username'
could not be activated. See the server's diagnostic trace logs for more information."}
WCF service is accessible.
So I allow trace for IdentityServer 2, in wcfTrace.svclog I found this:
Exception:
Could not find a base address that matches scheme http for the endpoint with binding CertificateWSTrustBinding. Registered base address schemes are [https].
Stak Trace:
Could not find a base address that matches scheme http for the endpoint with binding CertificateWSTrustBinding. Registered base address schemes are [https].
Stack Trace:
[InvalidOperationException: Could not find a base address that matches scheme http for the endpoint with binding CertificateWSTrustBinding. Registered base address schemes are [https].]
System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses) +8514770
System.ServiceModel.ServiceHostBase.AddServiceEndpoint(String implementedContract, Binding binding, Uri address, Uri listenUri) +114
System.ServiceModel.ServiceHost.AddServiceEndpoint(Type implementedContract, Binding binding, Uri address, Uri listenUri) +172
System.ServiceModel.ServiceHost.AddServiceEndpoint(Type implementedContract, Binding binding, String address, Uri listenUri) +97
Thinktecture.IdentityServer.Protocols.WSTrust.TokenServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +832
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +1961
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +66
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +740
[ServiceActivationException: The service '/issue/wstrust' cannot be activated due to an exception during compilation. The exception message is: Could not find a base address that matches scheme http for the endpoint with binding CertificateWSTrustBinding. Registered base address schemes are [https]..]
System.Runtime.AsyncResult.End(IAsyncResult result) +466
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +241
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +184
I try use sample WcfIdentity45 > WSTrust > Symmetric from Pluralsight course Identity and Access Control in WCF 4.5.
Course url.
I use IdentityServer v2.5.
From client I request for token via WSTrustChannelFactory.
When I call Issue method I get error:
WCF service is accessible.
So I allow trace for IdentityServer 2, in wcfTrace.svclog I found this:
Exception:
Could not find a base address that matches scheme http for the endpoint with binding CertificateWSTrustBinding. Registered base address schemes are [https].
Stak Trace:I am confure because I code I don’t use never CertificateWSTrustBinding only ws2007FederationHttpBinding.
EDITED:
I think this is root of problem when I hit https://domain:9988/issue/wstrust/ I get generic WCF error:
Could not find a base address that matches scheme http for the endpoint with binding CertificateWSTrustBinding. Registered base address schemes are [https].
Stack Trace:
What is wrong?