CNTLMAuthObject problem. Please Help.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kackson

    CNTLMAuthObject problem. Please Help.

    Hi.

    I would like to access a webpage that requires NTLM authentication. My
    code is very simple:

    // BEGIN
    CAtlHttpClient client;
    CAtlNavigateDat a navData;

    #if 1
    CNTLMAuthObject authObject;
    client.AddAuthO bj("NTLM", &authObject) ;
    #else
    CNTLMAuthObject authObject;
    AuthData authData; // inquire user for username, password and domain
    name
    client.AddAuthO bj("NTLM", &authObject, &authData);
    #endif

    client.Negotiat eAuth(false);
    client.Navigate ( "http://localhost/Examples/simple.aspx", &navData );
    int status = client.GetStatu s();

    client.Close();
    // END

    I always get access denied 401 error whenever I use the #else part of
    the code. But I would be able to access without problem if I use the
    #if 1 part of the code. I dont understand why. My authData contains
    the same username, password, and domain as the one I use to logon to
    my windows machine. What am I missing??
  • Bogdan Crivat [MSFT]

    #2
    Re: CNTLMAuthObject problem. Please Help.


    The default constructor for the CNTLMAuthObject uses the currently logged
    user and it does not need a user name or a password.

    Does the web site support Basic authentication?
    The user name/password from AuthData are used for the "BASIC" authentication
    scheme.

    --
    --
    --
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Please do not send email directly to this alias. It is for newsgroup
    purposes only.

    thanks,
    bogdan

    "kackson" <kackson@yahoo. com> wrote in message
    news:90250227.0 407142234.be68a b8@posting.goog le.com...[color=blue]
    > Hi.
    >
    > I would like to access a webpage that requires NTLM authentication. My
    > code is very simple:
    >
    > // BEGIN
    > CAtlHttpClient client;
    > CAtlNavigateDat a navData;
    >
    > #if 1
    > CNTLMAuthObject authObject;
    > client.AddAuthO bj("NTLM", &authObject) ;
    > #else
    > CNTLMAuthObject authObject;
    > AuthData authData; // inquire user for username, password and domain
    > name
    > client.AddAuthO bj("NTLM", &authObject, &authData);
    > #endif
    >
    > client.Negotiat eAuth(false);
    > client.Navigate ( "http://localhost/Examples/simple.aspx", &navData );
    > int status = client.GetStatu s();
    >
    > client.Close();
    > // END
    >
    > I always get access denied 401 error whenever I use the #else part of
    > the code. But I would be able to access without problem if I use the
    > #if 1 part of the code. I dont understand why. My authData contains
    > the same username, password, and domain as the one I use to logon to
    > my windows machine. What am I missing??[/color]


    Comment

    • kackson

      #3
      Re: CNTLMAuthObject problem. Please Help.

      "Bogdan Crivat [MSFT]" <bogdanc@online .microsoft.com> wrote in message news:<eInjs1kaE HA.4092@TK2MSFT NGP11.phx.gbl>. ..[color=blue]
      > The default constructor for the CNTLMAuthObject uses the currently logged
      > user and it does not need a user name or a password.
      >
      > Does the web site support Basic authentication?
      > The user name/password from AuthData are used for the "BASIC" authentication
      > scheme.
      >[/color]

      Hi. Is it possible to change the default setting so that it can accept
      and use the password and user name that I provide? Since my
      application may be open to more than one user on the same terminal, I
      would like the users be authenticated with the password and username.
      But, at the same time, I dont want to use basic authentication since
      the password would be sent in plain text form. Is there anyway I could
      change the constructor so that it accept and use the password I
      supply? Deeply appreciate any pointers.

      Comment

      Working...