I’m trying to enable security on REST++ endpoints. I’ve created a Secret but I get the error below when trying to create a token. I’ve checked the list of endpoints available and requesttoken isn’t present. Should requesttoken be available “out of the box” or does it need to be enabled in some way?
h:>curl -X GET “<my_server>:9000/requesttoken?secret=<my_secret_string>&lifetime=157680000”
{“version”:{“edition”:“enterprise”,“api”:“v2”,“schema”:253},“error”:true,“message”:“Endpoint is not found from url = /requesttoken, please use GET /endpoints to list all valid endpoints.”,“code”:“REST-1000”}
1 Like
To enable REST authentication you need to do the follow:
gadmin –configure RESTPP.Authentication
set to --> set to TRUE
gadmin config-apply
gadmin restart restpp nginx vis -y
The Token Creation REST endpoint is one of those default endpoints.
curl -X GET 'localhost:9000/requesttoken?secret=jiokmfqqfu2f95qs6ug85o89rpkneib3&lifetime=1000000'
You can also try using this notebook I created. Just go to “File” > “Save as Copy” > enter your parameters. Run notebook from top to bottom.
https://colab.research.google.com/drive/1sYv3Jvc6KYsqC4D-Rxkvjh4iPnrp4rg7
But the CURL command you used looks correct. Enable the REST Auth in your gadmin configs and try again!