Endpoint: /sites/{siteId}/authentication

Returns current authentication settings for the Site ID specified on the request; To obtain the Site ID a GET request will need to be done against the /sites endpoint prior to making this request.

  • GET

  • PATCH

Method & URL

PATCH https://[server URL]:[port]/admin/v2/sites/{siteid}/authentication

GET Body Sample

Copy
###  GET Site Authenticatin Provider (EFT, AD, LDAP, ODBC) ###
GET https://{{host}}/admin/v2/sites/{{Siteid}}/authentication/
HTTP/1.1 Authorization: EFTAdminAuthToken {{AuthToken}}

GET Response Body Sample

Copy
{
  "data": {
    "id": "3e2cae3a-db0f-44bd-812d-4ca6b0f04c91",
    "type": "siteAuthentication",
    "attributes": {
      "advancedAuth": {},
      "userAuth": {
        "type": "LDAP",
        "ldap": {
          "advanced": {
            "ldapVersion": {
              "enabled": true,
              "version": 3
            },
            "overrideSearchPage": {
              "enabled": true,
              "size": 1000
            },
            "referralChasingEnabled": false,
            "searchScope": {
              "enabled": true,
              "level": 2
            },
            "serverSidePageControlEnabled": true,
            "timeOut": {
              "enabled": true,
              "seconds": 60
            },
            "userAttributes": {
              "enabled": true,
              "value": {
                "custom1": [],
                "custom2": [],
                "custom3": [],
                "email": [
                  "mail",
                  "email"
                ],
                "fullName": [
                  "name",
                  "cn"
                ],
                "settingTemplate": []
              }
            }
          },
          "host": {
            "attribute": "cn",
            "baseDn": "",
            "port": 389,
            "server": "",
            "userFilter": "(objectClass=person)"
          },
          "onlySyncUserOnFirstLogin": false,
          "refreshInterval": {
            "inherited": true,
            "enabled": 0,
            "minutes": 0
          },
          "useSsl": false,
          "user": {
            "name": "",
            "password": ""
          }
        }
      }
    }
  },
  "links": {
    "self": "/admin/v2/sites/3e2cae3a-db0f-44bd-812d-4ca6b0f04c91/authentication"
  }
}

GET PowerShell Sample

Copy
####Added 2/02/2022
### GET Site Authentication Provider (EFT, AD, LDAP, ODBC) ###
### User must obtain the SiteID from Get Sites
Write-Output "Site Authentication Provider "
Write-Output "----"
#$siteID = Enter SiteID here
$siteList = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/authentication" -Method 'GET' -Headers $authHeader
Write-Output $siteList | ConvertTo-Json 

Method & URL

PATCH https://[server URL]:[port]/admin/v2/sites/{siteid}/authentication

PATCH Body Sample

Copy
###This example will Set ODBC as the Authentication type and enable radius
#PATCH Site Authentication type
PATCH https://{{host}}/admin/v2/sites/{{Siteid}}/authentication/ HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
{
  "data": {
    "id": "",
    "type": "site",
    "attributes": {
      "userAuth": {
        "type": "ODBC",
        "odbc": {
          "connectionString": "Provider=MSDASQL;SERVER=;DATABASE=ODBC;UID=sa;PWD= ",
          "encryptUserPassword": true,
          "refreshInterval": {
            "inherited": true,
            "enabled": false,
            "minutes": 0
          }
        }
      },
      "advancedAuth": {
        "type": "radius",
        "radius": {
          "server": "",
          "port": 0,
          "nasIdentifier": "",
          "sharedSecret": "",
          "connectionRetries": 0,
          "timeOutSeconds": 0
        }
      }
    }
  }
}

GET Response Body Sample

Copy
{
  "data": {
    "id": "c4d4bf76-2172-41e7-9ed1-3c2d0de1254c",
    "type": "siteAuthentication",
    "attributes": {
      "advancedAuth": {
        "type": "radius",
        "radius": {
          "connectionRetries": 0,
          "nasIdentifer": "",
          "port": 0,
          "server": "",
          "sharedSecret": "",
          "timeOutSeconds": 0
        }
      },
      "userAuth": {
        "type": "ODBC",
        "odbc": {
        "connectionString": "Provider=MSDASQL;SERVER=;DATABASE=ODBC;UID=sa;PWD=",
          "encryptUserPassword": true,
          "refreshInterval": {
            "inherited": true,
            "enabled": 0,
            "minutes": 0
          }
        }
      }
    }
  },
  "links": {
    "self": "/admin/v2/sites/c4d4bf76-2172-41e7-9ed1-3c2d0de1254c/authentication"
  }
}

PATCH PowerShell Sample

Copy
### PATCH Site Authentication Provider (EFT, AD, LDAP, ODBC) ###
### User must obtain the SiteID from Get Sites
Write-Output "PATCH Site Authentication Provider"
Write-Output "-----"
$update = 
'{
  "data": {
    "id": "",
    "type": "site",
    "attributes": {
      "userAuth": {
        "type": "ODBC",
        "odbc": {
          "connectionString": "Provider=MSDASQL;SERVER=192.168.100.70;DATABASE=ODBC;UID=sa;PWD=alaska",
          "encryptUserPassword": true,
          "refreshInterval": {
            "inherited": true,
            "enabled": false,
            "minutes": 0
          }
        }
      },
      "advancedAuth": {
        "type": "radius",
        "radius": {
          "server": "",
          "port": 0,
          "nasIdentifier": "",
          "sharedSecret": "",
          "connectionRetries": 0,
          "timeOutSeconds": 0
        }
      }
    }
  }
}'
$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 9
$patchReturn = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/authentication" -Method 
'PATCH' -Headers $authHeader -Body $update