Is it possible to integrate asp.net authentication with openlayers?
I have created a Login page for authenticating in openlayers using C# on the server side. Here is an example of my code:
Uri uri = new Uri("http://"+username+":"+password+"@localhost:1979/geoserver/wms");
if (uri.Scheme == Uri.UriSchemeHttp)
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
request.Method = WebRequestMethods.Http.Post;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
string tmp = reader.ReadToEnd();
response.Close();
Response.Write(tmp);
}
I'm not sure if this method is correct for solving my issue. If I successfully authenticate with username and password in geoserver, how can I combine this authentication with openlayers, which runs on the user's browser side using JavaScript?
Thank you in advance