Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIP2 Authentication #4

Open
advation opened this issue Jul 20, 2017 · 2 comments
Open

SIP2 Authentication #4

advation opened this issue Jul 20, 2017 · 2 comments

Comments

@advation
Copy link

Is there a way to add a user/password to allow authentication to a SIP2 service?

@cap60552
Copy link
Owner

The SIP2 protocol supports authentication, but it has to be turned on in the server. The module supports the protocol calls although I don't have a server that requires authentication to test against.
It is possible to write in any authentication you need (LDAP, OAUTH, SAML, etc) into your script then make the SIP2 calls only if the user is able to authenticate. I've done exactly that inside Drupal, and in another CMS at my library.

@PhillipBrickner
Copy link

PhillipBrickner commented Jan 22, 2018

Figured out the Authentication. rewrote a bit since the password and username will be the same.

/* Login Variables /
public $UIDalgorithm = 0; /
0 = unencrypted, default /
public $PWDalgorithm = 0; /
undefined in documentation /
public $sipLogin = 'username';
public $sipPassword = 'password';
public $scLocation = ''; /
Location Code */
public $sipVendorProfile = 'Envisionware'; /*Envisionware, Comprise, 3M, ITG */

function msgLogin() 
{
    /* Login (93) - untested */
    $this->_newMessage('93');
    $this->_addFixedOption($this->UIDalgorithm, 1);
    $this->_addFixedOption($this->PWDalgorithm, 1);
    $this->_addVarOption('CN',$this->sipLogin);
    $this->_addVarOption('CO',$this->sipPassword);
    $this->_addVarOption('CP',$this->scLocation, true);
    $this->_addVarOption('VP',$this->sipVendorProfile, true);
return $this->_returnMessage();

}

Then something like this
$login_response = $mysip->get_message($mysip->msgLogin());
and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants