473,399 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Auth Problem

I have the following web method:

<WebMethod()> _
Public Function Test_CurrentCredentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threading.Thread.CurrentPrincipal.Identity. Name
tmpArr(1) =
System.Threading.Thread.CurrentPrincipal.Identity. AuthenticationType.ToString
tmpArr(2) =
System.Threading.Thread.CurrentPrincipal.Identity. IsAuthenticated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Service1
svc.Credentials = System.Net.CredentialCache.DefaultCredentials
tmpArr = svc.Test_CurrentCredentials

The app is Windows Forms app.

When I run the app I get the following error:
The request failed with HTTP status 401: Access Denied
I have Disabled Anonymous authentication for my Web Service folder. Only
Integrated Windiows Authentication is active.
In my Web Service web.config file I have thi line:
<authentication mode="Windows" />
When Anonymous is Enabled I can connect to service.

I have auditing turned on and doesn't show nothing.
What is the problem?

Tia
Nov 18 '05 #1
3 1128
Also with "Basic" Authentication everything works fine

"Nikolay Petrov" <jo******@mail.bg> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I have the following web method:

<WebMethod()> _
Public Function Test_CurrentCredentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threading.Thread.CurrentPrincipal.Identity. Name
tmpArr(1) =
System.Threading.Thread.CurrentPrincipal.Identity. AuthenticationType.ToString
tmpArr(2) =
System.Threading.Thread.CurrentPrincipal.Identity. IsAuthenticated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Service1
svc.Credentials = System.Net.CredentialCache.DefaultCredentials
tmpArr = svc.Test_CurrentCredentials

The app is Windows Forms app.

When I run the app I get the following error:
The request failed with HTTP status 401: Access Denied
I have Disabled Anonymous authentication for my Web Service folder. Only
Integrated Windiows Authentication is active.
In my Web Service web.config file I have thi line:
<authentication mode="Windows" />
When Anonymous is Enabled I can connect to service.

I have auditing turned on and doesn't show nothing.
What is the problem?

Tia

Nov 18 '05 #2
This sounds like a double hop issue to me then. You probably have an
impersonation token with WIA and a primary token with Basic. The
impersonation token can't make another machine hop, but the primary token
can.

The solution to this is usually to use delegation.

http://msdn.microsoft.com/vstudio/us...lementKerberos

Joe K.

"Nikolay Petrov" <jo******@mail.bg> wrote in message
news:uD**************@TK2MSFTNGP11.phx.gbl...
Also with "Basic" Authentication everything works fine

"Nikolay Petrov" <jo******@mail.bg> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I have the following web method:

<WebMethod()> _
Public Function Test_CurrentCredentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threading.Thread.CurrentPrincipal.Identity. Name
tmpArr(1) =
System.Threading.Thread.CurrentPrincipal.Identity. AuthenticationType.ToString
tmpArr(2) =
System.Threading.Thread.CurrentPrincipal.Identity. IsAuthenticated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Service1
svc.Credentials = System.Net.CredentialCache.DefaultCredentials
tmpArr = svc.Test_CurrentCredentials

The app is Windows Forms app.

When I run the app I get the following error:
The request failed with HTTP status 401: Access Denied
I have Disabled Anonymous authentication for my Web Service folder. Only
Integrated Windiows Authentication is active.
In my Web Service web.config file I have thi line:
<authentication mode="Windows" />
When Anonymous is Enabled I can connect to service.

I have auditing turned on and doesn't show nothing.
What is the problem?

Tia


Nov 18 '05 #3
Is the app on the calling computer running as a domain user account? If not,
you might want to replace

svc.Credentials = System.Net.CredentialCache.DefaultCredentials

with:

Dim credentials=New NetworkCredential("domainuser", "password", "MYDOMAIN")
svc.Credentials=credentials


"Nikolay Petrov" wrote:
Also with "Basic" Authentication everything works fine

"Nikolay Petrov" <jo******@mail.bg> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I have the following web method:

<WebMethod()> _
Public Function Test_CurrentCredentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threading.Thread.CurrentPrincipal.Identity. Name
tmpArr(1) =
System.Threading.Thread.CurrentPrincipal.Identity. AuthenticationType.ToString
tmpArr(2) =
System.Threading.Thread.CurrentPrincipal.Identity. IsAuthenticated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Service1
svc.Credentials = System.Net.CredentialCache.DefaultCredentials
tmpArr = svc.Test_CurrentCredentials

The app is Windows Forms app.

When I run the app I get the following error:
The request failed with HTTP status 401: Access Denied
I have Disabled Anonymous authentication for my Web Service folder. Only
Integrated Windiows Authentication is active.
In my Web Service web.config file I have thi line:
<authentication mode="Windows" />
When Anonymous is Enabled I can connect to service.

I have auditing turned on and doesn't show nothing.
What is the problem?

Tia


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: jsWalter | last post by:
I have an extension Class to Auth and I'm looking for some folks to hammer on it a bit and give feed back. Class: AuthUser - add user (well, Auth does that now, so its gone) - remove user...
3
by: Dan Stromberg | last post by:
If I wanted to write a python script that performs basic auth, gets a cookie, and then does an http POST using the cookie for authentication, what would be the best python API to write to? Does...
0
by: Alex Hunsley | last post by:
I've recently started integrating PHP Auth (http://php.rufy.com/) into my PHP application. I've had a few problem with it though: I've fixed two bugs, one of which was quite glaring - it basically...
0
by: Ciaran McAuliffe | last post by:
Hey, I have a bit of a tricky problem, here is a quick overview. I have a website which connects to a webservice, this web service is a front for access to the Reporting Services Web Service, the...
4
by: 23s | last post by:
I had this problem in the past, after a server reformat it went away, and now after another server reformat it's back again - no clue what's doing it. Here's the flow: Website root is public, no...
10
by: Henk van Lingen | last post by:
Hi, docs say (19.2.1): When trust authentication is specified, PostgreSQL assumes that anyone who can connect to the server is authorized to access the database as whatever database user he...
3
by: Thomas.Firnschrott | last post by:
i have a problem concerning a php script i worte some time ago. It is a rather simple thing. On a Site you login via a html form which points to a php that checks the username and password, and...
0
by: kevin bailey | last post by:
I have a framework working where I have multiple pages each checking the authentication status. Unauthorised users are redirected to a login page - otherwise the requested page is shown. ...
1
by: kevin bailey | last post by:
I have used the PEAR Auth package to successfully set up authentication. <code> // Details of where the authentication details are stored. $options = array( 'dsn'...
3
by: hakan | last post by:
I've started playing with the Auth module, and I have a quick question before I go any deeper. Is it possible to embedd the Auth login form in an HTML page? I would like to put a login form in a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.