Giter Site home page Giter Site logo

php-ntlm's Introduction

PHP NTLM

The PHP NTLM library (php-ntlm) is intended to provide various methods to aid in communicating with Microsoft services that utilize NTLM authentication from within PHP.

Scrutinizer Total Downloads

Dependencies

  • Composer
  • PHP 5.4 or greater
  • cURL with NTLM support (7.23.0+ recommended)

Installation

The preferred installation method is via Composer, which will automatically handle autoloading of classes.

{
    "require": {
        "jamesiarmes/php-ntlm": "~1.0"
    }
}

Usage

SoapClient

The \jamesiarmes\PhpNtlm\SoapClient class extends PHP's built in SoapClient class and can be used in the same manner with a few minor changes.

  1. The constructor accepts a required 'user' and 'password' index in the $options array.
  2. The constructor accepts an optional 'curlopts' index in the $options array that can be used to set or override the default curl options.

Basic example:

$client = new SoapClient(
    $wsdl,
    array('user' => 'username', 'password' => '12345')
);

Example that skips SSL certificate validation:

$client = new SoapClient(
    $wsdl,
    array(
        'user' => 'username',
        'password' => '12345',
        'curlopts' => array(CURLOPT_SSL_VERIFYPEER => false),
    )
);

Available options

The basic options available on the constructor can be found at http://php.net/manual/en/soapclient.soapclient.php. The trace option is not necessary, as the last request and response methods will always be available. In addition to these options, the following additional options are available:

  • user (string, required): The user to authenticate with.
  • password (string, required): The password to use when authenticating the user.
  • curlopts (array): Array of options to set on the curl handler when making the request. This can be used to override any cURL options with the exception of the following: CURLOPT_HEADER, CURLOPT_POST, CURLOPT_POSTFIELDS.
  • strip_bad_chars (boolean, default: true): Whether or not to strip invalid characters from the XML response. This can lead to content being returned differently than it actually is on the host service, but can also prevent the "looks like we got no XML document" SoapFault when the response includes invalid characters.
  • warn_on_bad_chars (boolean, default: false): Trigger a warning if bad characters are stripped. This has no affect unless strip_bad_chars is true.

Projects that use php-ntlm

The following is a list of known projects that use this library. If you would like to add your project to the list, please open a pull request to update this document.

php-ntlm's People

Contributors

jamesiarmes avatar das-peter avatar benyanke avatar dwarfex avatar ondra-marik avatar pavog avatar rubenrubiob avatar

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.