How to: Generate an access token to authenticate with the BIG-IP Next Central Manager APIΒΆ
To authenticate with the BIG-IP Next Central Manager API:
Get an access token by sending a POST request to the
/api/login
endpoint.POST https://<big-ip_next_cm_mgmt_ip>/api/login
For the API body, use the following, substituting the username and password for the BIG-IP Next Central Manager you are accessing.
{ "username": "username", "password": "********" }
Response:
{ "access_token": "+42Cvb6we9wsgqDtJLZHMHZ2lAk9LYR5/w+rMvTkPvm5KVJbe9Pvzg0Tdg+F7Vis4CRNAxsPStHP9cSn7lRONWPB+IA4HGJuJWAHtXyWfwvTeMakA36CqhlZKACfgukLEvj0u5IBzNFAL3vdniPDmvJIL9HpGkNyCIVrKGE7rrmAdiyOP6x01WjTILSlM2m26/cfheF04U8q8uzygMUXBLdAkNkVziBkTTwzMnQkTmAqTxhrSsaktS9FYbfeuul3mA602IiaWlT8noewxZ5bu3pehI18Ckyh3IXX7GpfcmCmgmWUA5r9Zif2URn5Lp57kfnWK4kzw/LVvX5dZ6VD2YN+MSTuYAAd1lflFLFmGlWK/LEA/4MaMGU2+LWBo7vyvv+ur7837pKNjwKtQ9uZBNDfaAsrz2eXAa+AXp92dxrTspTY4I8gZnUTGc7k36iDxJW5t9/Ja3Qyold8y/F/t4vzIZvPSK5u/ivkcfbfvC0JUPP2+f5OpCmVng4FC6fqOF8p+zo9", "refresh_token": "+42Cvb6we9wsgqDtJLZHMHZ2lAk9LYR5/w+rMvTkPvm5KVJbe9Pvzg0Tdg+F7Vis4CRNAxsPStHP9cSn7lRONWPB+IA4HGJuJWAHtXyWfwvTeMakA36CplRaKDKfgvkLEvj0u5IBzNFAL3vdniPDmvJIL9HqGkNyCIVrKGE7rrmAdiyOP6x01WjTILSlM2m26/cfheF04U8q8uzygcUXBLdAkNkVziBkTTwzMnQkTmN0WCV3SMSntndFW7aCrsdZ1A602ImNc1T8iK2gxZ1hu35Kg7BsHmWl3pP57G9IZUKmgmWUA5r9Zif2URn5Lp57kfnWK4kzw/LVvX5dZ6VD2YN+MSTuYAAd1lflFLFmGlWK/LEA/4MaMGU2+LWBo7vyreeb0oEx1pCzggmoCNjuHaaWCw1J+FCPLrvrJZNfQUO7+Nb5+9NFclIxBIz1x6rS7biJxdrjeHgIgx9UlZlcz8qpF+nbE79K0ijXPorNlAMuBPyM5ti7buodAxh2BcJYNuf+IVhI" }
Add the generated access token to send the BIG-IP Next Central Manager API calls in one of two ways:
Replace the
access_token
with the generated access token in the following code.
--header 'Authorization: Bearer access_token'
In the API tool,
a. Save the token in a variable such as{{bigip_next_cm_token}}
. See the following example to use in Postman:pm.test("Login status code is 200", function () { pm.response.to.have.status(200); }); var resp = pm.response.json(); pm.collectionVariables.set("bigip_next_cm_token", resp.access_token);
b. Select Authorization tab and select Bearer Token from the Auth Type drop down.
c. In the Token field, enter the access token variable as shown in the Step 1 example.
Note: Whenever the access token expires, resend the login API to generate a new token.