Authorisation problem

Last post 05-18-2008 11:07 PM by XiaoYong Dai – MSFT. 3 replies.

Sort Posts:

  • Authorisation problem

    05-14-2008, 3:59 AM

    Hi All, I do not know much about ASP.Net and IIS authorisation and authentication, the problem I am facing is like this, whenever I disabled the Anonymous Acces in IIS (Windows XP and .Net 2.0) and run my application it always prompt me to enter username and password with windows login dialog, when I enter my windows username and password and click on login it does not accept and when i continously click for 4 times the page displays to me that I am not authorised to view the page. and when I enabled that feature, I got a different error message

     

    Need help please.

     

     

  • Re: Authorisation problem

    05-15-2008, 11:53 PM
    Answer

    Hi

    Please verify the authentication mode in your web.config, By default it's windows authentication. You may need to change it like this:

       <authentication mode="Forms">
       <forms loginUrl="login.aspx"></forms>
      </authentication>

    Best Regards
    XiaoYong Dai
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Authorisation problem

    05-17-2008, 6:41 AM
    Answer

    Dear,

    Actually I am using Windows XP - SP2 .  My friends who are working on the same project using the same settings with same OS does not have any problem by disabling Anonymous user from their IIS settings. The problem is that when I change my IIS settings exactly same with my friends' settings I got the login/authorisation problem but my friends does not get. This made me suspect that there is some problem in my OS settings related to web application (IIS, ASP.Net and related applications).

    We do not wanted to use form authentication or something else, what we want is to disable "Anonymous" user, enable "Integrated Windows Authentication" and able to open the page without any prompt for Username and Password. Below is our piece of code which will retrieve username

     

    1    public static string GetCurrentUsername() 
    2    {
    3    	string user = System.Security.Principal.WindowsIdentity.GetCurrent().Name;//It does not assign value to variable user
    4    	//string user = HttpContext.Current.Request.ServerVariables["LOGON_USER"];//This does not work either
    5    	int domainIndex = user.IndexOf(@"\");
    6    	if (domainIndex != -1)
    7    		return user.Substring(domainIndex + 1);
    8    	return user;
    9    }
     
    I badly need help, what can i do, please friends help me.



    Regards,
     
      
  • Re: Authorisation problem

    05-18-2008, 11:07 PM

    Suan Ngaihte:
    got the login/authorisation problem but my friends does not get. This made me suspect that there is some problem in my OS settings related to web application (IIS, ASP.Net and related applications).

    Hi

    Have you enabled "automatic logon with current username and password"? It will automaticly send current credential to IIS for authentication

        Steps for Internet Explorer: Tools>Internet Options>Security>choose Security Zone>Custom level>User Authenticationto "automatic logon with current username and password".

    Best Regards
    XiaoYong Dai
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Page 1 of 1 (4 items)