You will need to create a .NET proxy to the SOAP API, as follows:
When creating your .NET client application, remember to add a reference to this proxy. You will also need to add a reference to System.Web.Services.DLL. The sample code calls methods from the proxy to perform authentication in a sample Crowd application. Change the constants at the top of the code relevant to any application you have previously set up in Crowd.
Related Topics |

Comments (1)
Mar 14, 2007
Jean Verger says:
(i) Validation Factors and Unitque Tokens\\ The example provided in the code w...The example provided in the code works great.
However, it misses pointing out about ValidationFactors which, as far as I am understanting, allows CROWD to provide unique tokens based on those Factors.
Here the C# to add validation factors as well as the code to retrieve the IP and User Agent of the client.
Hope it helps
Adding Validation Factors
ValidationFactor fIP = new ValidationFactor();
fIP.name = "REMOTE_ADDRESS";
fIP.value = ip;
ValidationFactor fBrowser = new ValidationFactor();
fBrowser.name = "USER_AGENT";
fBrowser.value = browser;
ValidationFactor[] vFactor = new ValidationFactor[2];
vFactor.SetValue(fIP, 0);
vFactor.SetValue(fBrowser, 1);
Your_Principal_Context.validationFactors = vfactor,
_securityServer.authenticatePrincipal(appToken, Your_Principal_Context);
Retrieving IP and User Agent from the Client
HttpContext context = HttpContext.Current;
HttpResponse response = context.Response;
HttpRequest request = context.Request;
string sUseragent = request.Headers["User-Agent"];
string sIP1 = request.ServerVariables["REMOTE_ADDR"].ToString();
string sIP2 = "";
string sIP = "";
if (request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null)
{
sIP2 = request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
}
sIP = (sIP2 != "") ? sIP2 : sIP1;
Add Comment