WCF Windows Service with ASP.net Application authentication problem...
-
I'm trying to get a ASP.net application to talk to a WCF Windows Service. Both are on the same internal network and belong to the same domain, but are on different machines. When connecting I see on the tracing log on my WCF Windows Service:
System.IdentityModel.Tokens.SecurityTokenValidationException: The service does not allow you to log on anonymously.
From what I understand WCF will use windows authentication by default. How do I pass credentials to the WCF service? This is how i'm connecting from the ASP.net client:
public static string Authenticate(string username, string password) { DomainControllerClient dc = null; try { dc = new DomainControllerClient(); dc.Open(); bool success = dc.Authenticate(username, password); if (success) return "OK"; else return "FAIL"; } catch (Exception ex) { return ex.ToString(); } finally { if (dc.State == CommunicationState.Opened) dc.Close(); else if (dc.State == CommunicationState.Faulted) dc.Abort(); dc = null; } }
** BTW I'm using netTcpBinding
-
I'm trying to get a ASP.net application to talk to a WCF Windows Service. Both are on the same internal network and belong to the same domain, but are on different machines. When connecting I see on the tracing log on my WCF Windows Service:
System.IdentityModel.Tokens.SecurityTokenValidationException: The service does not allow you to log on anonymously.
From what I understand WCF will use windows authentication by default. How do I pass credentials to the WCF service? This is how i'm connecting from the ASP.net client:
public static string Authenticate(string username, string password) { DomainControllerClient dc = null; try { dc = new DomainControllerClient(); dc.Open(); bool success = dc.Authenticate(username, password); if (success) return "OK"; else return "FAIL"; } catch (Exception ex) { return ex.ToString(); } finally { if (dc.State == CommunicationState.Opened) dc.Close(); else if (dc.State == CommunicationState.Faulted) dc.Abort(); dc = null; } }
** BTW I'm using netTcpBinding