CredentialCache.DefaultCredentials not working!!!!!

Discussion in 'ASP .Net Security' started by Paul Cheevers, Sep 7, 2004.

  1. Hi,

    I'm trying to use the CredentialCache.DefaultCredentials to pick up the
    credentials of the current user but its not working correctly. I've switched
    off anonymous access and gone thru the code in debug mode but I keep getting
    a 401 security exception. The code works perfect if I hard code a user name
    and password.

    After a lot of messing around I got it to work on the server (if I navigate
    to the webpart that contains the code from a browser on the actual server)
    when I set my browser to automatically logon on. However the code still
    breaks on client machines even if I make this change.

    This is driving me nuts, any help or suggestions would be appreciated.

    Cheers,
    Paul
     
    Paul Cheevers, Sep 7, 2004
    #1
    1. Advertising

  2. You should be communicating this in the appropriate beta group rather than
    this one which is for released software

    --

    OHM ( Terry Burns )
    . . . One-Handed-Man . . .
    If U Need My Email ,Ask Me

    Time flies when you don't know what you're doing

    "Paul Cheevers" <> wrote in message
    news:...
    > Hi,
    >
    > I'm trying to use the CredentialCache.DefaultCredentials to pick up the
    > credentials of the current user but its not working correctly. I've

    switched
    > off anonymous access and gone thru the code in debug mode but I keep

    getting
    > a 401 security exception. The code works perfect if I hard code a user

    name
    > and password.
    >
    > After a lot of messing around I got it to work on the server (if I

    navigate
    > to the webpart that contains the code from a browser on the actual server)
    > when I set my browser to automatically logon on. However the code still
    > breaks on client machines even if I make this change.
    >
    > This is driving me nuts, any help or suggestions would be appreciated.
    >
    > Cheers,
    > Paul
    >
    >
     
    One Handed Man \( OHM - Terry Burns \), Sep 7, 2004
    #2
    1. Advertising

  3. Thanks for the reply......

    I'm talking about code in a webpart on WSS

    ????


    "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
    news:...
    > You should be communicating this in the appropriate beta group rather than
    > this one which is for released software
    >
    > --
    >
    > OHM ( Terry Burns )
    > . . . One-Handed-Man . . .
    > If U Need My Email ,Ask Me
    >
    > Time flies when you don't know what you're doing
    >
    > "Paul Cheevers" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > I'm trying to use the CredentialCache.DefaultCredentials to pick up the
    > > credentials of the current user but its not working correctly. I've

    > switched
    > > off anonymous access and gone thru the code in debug mode but I keep

    > getting
    > > a 401 security exception. The code works perfect if I hard code a user

    > name
    > > and password.
    > >
    > > After a lot of messing around I got it to work on the server (if I

    > navigate
    > > to the webpart that contains the code from a browser on the actual

    server)
    > > when I set my browser to automatically logon on. However the code still
    > > breaks on client machines even if I make this change.
    > >
    > > This is driving me nuts, any help or suggestions would be appreciated.
    > >
    > > Cheers,
    > > Paul
    > >
    > >

    >
    >
     
    Paul Cheevers, Sep 7, 2004
    #3
  4. A few questions:
    Are you using Windows Integrated Auth. on the server?
    Are you impersonating the logged on user (I think WSS does this by default,
    but I'm not sure)?
    Is this code running on the server?

    If the above are true, then you have an impersonation token on the server
    and those credentials will not hop to a different machine unless you have
    Kerberos delegation enabled and working. That sounds like what is happening
    here.

    Check out this link and also try searching for double-hop. That should get
    you started:
    http://msdn.microsoft.com/vstudio/u...l/SecNetHT05.asp?FRAME=true#ImplementKerberos

    Joe K.

    "Paul Cheevers" <> wrote in message
    news:...
    > Hi,
    >
    > I'm trying to use the CredentialCache.DefaultCredentials to pick up the
    > credentials of the current user but its not working correctly. I've

    switched
    > off anonymous access and gone thru the code in debug mode but I keep

    getting
    > a 401 security exception. The code works perfect if I hard code a user

    name
    > and password.
    >
    > After a lot of messing around I got it to work on the server (if I

    navigate
    > to the webpart that contains the code from a browser on the actual server)
    > when I set my browser to automatically logon on. However the code still
    > breaks on client machines even if I make this change.
    >
    > This is driving me nuts, any help or suggestions would be appreciated.
    >
    > Cheers,
    > Paul
    >
    >
     
    Joe Kaplan \(MVP - ADSI\), Sep 7, 2004
    #4
  5. Sorry my mistake, it seems to be a day of mistakes for me, I think I need a
    coffee

    --

    OHM ( Terry Burns )
    . . . One-Handed-Man . . .
    If U Need My Email ,Ask Me

    Time flies when you don't know what you're doing

    "Paul Cheevers" <> wrote in message
    news:...
    > Thanks for the reply......
    >
    > I'm talking about code in a webpart on WSS
    >
    > ????
    >
    >
    > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

    message
    > news:...
    > > You should be communicating this in the appropriate beta group rather

    than
    > > this one which is for released software
    > >
    > > --
    > >
    > > OHM ( Terry Burns )
    > > . . . One-Handed-Man . . .
    > > If U Need My Email ,Ask Me
    > >
    > > Time flies when you don't know what you're doing
    > >
    > > "Paul Cheevers" <> wrote in message
    > > news:...
    > > > Hi,
    > > >
    > > > I'm trying to use the CredentialCache.DefaultCredentials to pick up

    the
    > > > credentials of the current user but its not working correctly. I've

    > > switched
    > > > off anonymous access and gone thru the code in debug mode but I keep

    > > getting
    > > > a 401 security exception. The code works perfect if I hard code a user

    > > name
    > > > and password.
    > > >
    > > > After a lot of messing around I got it to work on the server (if I

    > > navigate
    > > > to the webpart that contains the code from a browser on the actual

    > server)
    > > > when I set my browser to automatically logon on. However the code

    still
    > > > breaks on client machines even if I make this change.
    > > >
    > > > This is driving me nuts, any help or suggestions would be appreciated.
    > > >
    > > > Cheers,
    > > > Paul
    > > >
    > > >

    > >
    > >

    >
    >
     
    One Handed Man \( OHM - Terry Burns \), Sep 21, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Craig
    Replies:
    1
    Views:
    10,988
    shobhaiyer
    Oct 3, 2007
  2. Paul Cheevers
    Replies:
    1
    Views:
    9,663
    Scott Allen
    Sep 7, 2004
  3. Chris Ericoli
    Replies:
    1
    Views:
    172
    Chris Ericoli
    Oct 21, 2003
  4. Ramdas

    CredentialCache.DefaultCredentials not working

    Ramdas, Jul 30, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    147
    Ramdas
    Jul 30, 2004
  5. Ramdas

    CredentialCache.DefaultCredentials Not working

    Ramdas, Jul 30, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    172
    Ramdas
    Jul 30, 2004
Loading...

Share This Page