Solved

Unauthorized 401 - Sorce:ASP.NET 2.0.50727.0 Event:1309

Posted on 2010-09-20
6
1,592 Views
Last Modified: 2012-05-10
Hi guys,

i have this error on the application, i can load the default.aspx OK but when i go to other page (ex:reports page) i have unauthorized error:

IIS 6
ASP 2.0
Use NTLM and Integrated Authentication.
Application Pool Identity: Domain\Service Account

I found this on Event Viewer:

Event Type:      Warning
Event Source:      ASP.NET 2.0.50727.0
Event Category:      Web Event
Event ID:      1309
Date:            9/20/2010
Time:            8:29:16 PM
User:            N/A
Computer:      Servername
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 9/20/2010 8:29:16 PM
Event time (UTC): 9/20/2010 6:29:16 PM
Event ID: 122d1d53a622474d897e4884649c6109
Event sequence: 138
Event occurrence: 23
Event detail code: 0
 
Application information:
    Application domain: /LM/W3SVC/1134278247/Root-1-129294788456184807
    Trust level: Full
    Application Virtual Path: /
    Application Path: E:\InetPub\ApplicationPath\
    Machine name: Servername
 
Process information:
    Process ID: 7148
    Process name: w3wp.exe
    Account name: Domain\Service Account
 
Exception information:
    Exception type: WebException
    Exception message: The request failed with HTTP status 401: Unauthorized.
 
Request information:
    Request URL: http://sitelocaltion.com/applicationname.aspx 
    Request path: /applicationname.aspx
    User host address: 10.155.12.113
    User: Domain\username
    Is authenticated: True
    Authentication Type: NTLM
    Thread account name: Domain\Service Account
 
Thread information:
    Thread ID: 1
    Thread account name: Domain\Service Account
    Is impersonating: False
    Stack trace:    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at SD4Service.SD4Service.SD4AccountProfile(String loginName)
   at ManageCampaign.Page_Load(Object sender, EventArgs e)
   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 
 
Custom event details:

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.


I found this on IIS Logs:

2010-09-20 18:29:16 W3SVC1134278247 Servername 10.155.12.113 GET /applicationname.aspx - 80 - 10.155.12.113 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.2;+SV1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729) - - csisurveyqas.app.pmi 401 2 2148074254 1843 323 31
2010-09-20 18:29:16 W3SVC1134278247 Servername 10.155.12.113 GET /applicationname.aspx - 80 - 10.155.12.113 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.2;+SV1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729) - - csisurveyqas.app.pmi  401 1 0 2015 425 15
2010-09-20 18:29:16 W3SVC1134278247 Servername 10.155.12.113 POST /SD4WebService/sd4Service.asmx - 80 - 10.155.12.113 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+2.0.50727.3615) - - Domain\Service Account 401 2 2148074254 1843 330 15
2010-09-20 18:29:16 W3SVC1134278247 Servername 10.155.12.113 GET /applicationname.aspx - 80 Domain\username 10.155.12.113 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.2;+SV1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729) - - csisurveyqas.app.pmi  500 0 0 5408 441 46

0
Comment
Question by:Gonzalo Becerra
  • 5
6 Comments
 
LVL 11

Expert Comment

by:lenordiste
ID: 33720162
are you trying to connect to a webservice in ManageCampaign.aspx by any chance?

if that is the case it's just a missing authorization for that webservice. If you are hosting the webservice you can try setting the "anonymous access" in IIS:
1. Open IIS
2. Right click webservice site and choose Properties
3. Click on the directory security tab.
4. Click the edit button in the Authentification box.
5. Check "Enable anonymous access"

you can also provide whatever necessary login information is needed by changing your code:

var myWebservice= new WebService1();
myWebservice.Credentials = new System.Net.NetworkCredential("myLogin",
"myPassword");
myWebservice.PreAuthenticate = true;

or if you want to use the default credentials:

var myWebservice= new WebService1();
myWebservice.Credentials = System.Net.CredentialCache.DefaultCredentials;


Hope this helps!

0
 
LVL 1

Author Comment

by:Gonzalo Becerra
ID: 33724379
Thanks, but the problem still perssist, i check annonymous and add NTFS Permissions for IUSR but is not problem. I administrator from server.
1 - I Check Connection User/Password for connect to SQL Server
2- I verfiied permissions NTFS
3- I Verified Authtentication Integrated NTLM
4- And in the same level have Default.aspx and work fine.
 
0
 
LVL 1

Author Comment

by:Gonzalo Becerra
ID: 33724518
Error
Error.JPG
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 1

Author Comment

by:Gonzalo Becerra
ID: 33724642
The application pool have a domain account, i think i need set SPN for this account?
I verified this
setspn -L Domain\Account
 Registered ServicePrincipalNames for CN=s-CSISurvey-qas,OU=Service Accounts,OU=Melbourne,OU=INT-ITSC,OU=PMI,OU=Member Servers,DC=PMINTL,DC=NET:
But when i go to ADSIEdit don't have set ServiceProviderName and in Active Directory Users&Computers > Computer Account > Delegation > Is Checked "Do not trust this computer for delegation".
0
 
LVL 1

Author Comment

by:Gonzalo Becerra
ID: 33725633
I make a troubleshooting doc with all i verified.
Troubleshootig-Unauthorized.doc
0
 
LVL 1

Accepted Solution

by:
Gonzalo Becerra earned 0 total points
ID: 33728149
I found errors on web.config
The problem is solved


1- Include the User of identity in group: PMI_CCC_AP_UR_CSISurvey_Qas_Admin because if specified in web.config
2- Verify in web.config this:
  a- <add key="TestMode" value="true"/>
  b- <add key="PoseAsLoginName" value="pmi\CZsolt"/>    
  c- verify webservice parameters.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question