DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1

ERS API Authentication


The ISE ERS API uses HTTP basic authentication, which
requires the credentials to be sent in the Authorization
header. The credentials are the username and password,
separated by a colon (:), within a Base64-encoded string.
For example, the Authorization header would contain the
following string:


Click here to view code image


"Basic ZGV2YXNjOnN0cm9uZ3Bhc3N3b3Jk"

In this case, ZGV2YXNjOnN0cm9uZ3Bhc3N3b3Jk
is the Base64-encoded string devasc:strongpassword
(where devasc is the username and strongpassword is
the password). Example 11-15 shows three lines of code
that do Base64 encoding to plug the value into the
Authorization headers.


Example 11-15 Python Code to Generate Base64
Encoding


Click here to view code image


import base64
encoded =
base64.b64encode('devasc:strongpassword'.encode('UTF-
8')).decode('ASCII')
print(encoded)

All ERS API calls are made to the URL https://<IP-of-
ISE>:9060/.


Now let’s look at a couple examples of ISE ERS endpoint
APIs.


Creating an Endpoint Group


The API posts the data to create a new endpoint group. It
uses the POST method and requires basic authentication
headers. The following shows the payload that is needed

Free download pdf