i keep getting authentication failed - no authentication credentials provided. can anyone give me a curl example or postman for example? i have setup a user just using the default root@pam and the name of the token is root@pam!datacenter but cant seem to get it to work out side the browser.
i am using requests from python heres the code minus the token:
edit: this works
i am using requests from python heres the code minus the token:
Python:
import requests
headers = {
'Authorization': 'PBSAPIToken=root@pam!datacenter:<TOKEN>'
}
response = requests.get('https://192.168.1.100:8443/api2/json/', headers=headers, verify=False)
print(resonse.json())
edit: this works
Python:
import requests
url = "https://192.168.1.100:8443/api2/json/"
headers = {"authorization": "PDMAPIToken=root@pdm!datacenter:<TOKEN-PART>"}
response = requests.get(url, headers=headers, verify=False)
print(response.json())
Last edited: