Coder Social home page Coder Social logo

Example of use about php-ntlm HOT 4 CLOSED

loune avatar loune commented on July 18, 2024
Example of use

from php-ntlm.

Comments (4)

loune avatar loune commented on July 18, 2024

myComputer is just the netbios name of the web server, but you could really make it anything that's alpha-numeric.

from php-ntlm.

jmvelasco avatar jmvelasco commented on July 18, 2024

Thanks for your replay loune.

I have changed the parameters to:

$auth = ntlm_prompt("http://redirect/site/after/login", "DOMAIN", "IIS_SERVER_HOST", "DOMAIN", "IIS_SERVER_HOST", "get_ntlm_user_hash");

The DOMAIN I have set is the same that is shown at the Windows Security popup below the user and password boxes.

I can't understand why we have to pass the domain and the computer twice. What is the difference with .local? I am setting the same values for both. Is that wrong?

On the callback function, for the moment I have hardcoded my user/password in the array.

I have added log messages and what I see is the check

if ($msg[8] == "\x01") { 

at line 216 is never true. Here is the log output: https://gist.github.com/jmvelasco/6315bdb238fbb13195f6

I am on a Server 2008 RS2 server with IIS 7.0 and the following settings:

  • IIS Authentication: Windows Authentication Only
    • Extended protocol Off
    • Enable Kernel-mode authentication
    • Providers:
      - Negotiate
      - NTLM
  • On the IE browser I have defined for the custom level at trusted zone the User Authentication - Logon to "automatic logon with current user name and passoword"

By the way, without your library and the settings described above I get the logged user with the sentence:
$user = $_SERVER['AUTH_USER'];

I would love to understand why I can't make to work your code.

Thanks in advance.

Regards.

from php-ntlm.

loune avatar loune commented on July 18, 2024

If you are using IIS, there's no need to use my script as IIS has native NTLM. As you found out, you can just get the username using $_SERVER['AUTH_USER']. This library is mainly for people who use nginx and apache, and on a server outside their domain.

from php-ntlm.

jmvelasco avatar jmvelasco commented on July 18, 2024

Great, I have found I coudn't get the headers from IIS, so the user-login popup was always shown.
I like your library by the way, good work!. Congrats.

from php-ntlm.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.