Skip to content

Commit 08ff740

Browse files
authored
Merge pull request #20 from lepidus/allowAuthenticationByAPITokens#18
Allow authentication by API tokens
2 parents 92bb03b + 71452f9 commit 08ff740

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

swordappclient.php

+4
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,10 @@ private function curl_init($sac_url, $sac_user, $sac_password) {
509509
if(!empty($sac_user) && !empty($sac_password)) {
510510
curl_setopt($sac_curl, CURLOPT_USERPWD, $sac_user . ":" . $sac_password);
511511
}
512+
513+
if(!empty($sac_user) && empty($sac_password)) {
514+
curl_setopt($sac_curl, CURLOPT_USERPWD, $sac_user . ": ");
515+
}
512516

513517
// Set user-specified curl opts
514518
foreach ($this->curl_opts as $opt => $val) {

0 commit comments

Comments
 (0)