We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I generated an app token, but I cannot use it.
I use it with: curl -v -X GET http://<my_server-Ip>api/v1/certificates -H 'Authorization: Token <MY_TOKEN>'
curl -v -X GET http://<my_server-Ip>api/v1/certificates -H 'Authorization: Token <MY_TOKEN>'
and also in python:
r = requests.get('http://<my_server-Ip>/api/v1/certificates?format=json', headers={'Authorization': 'Token <MY_TOKEN>'}) print(r) print(r.text)
but I always have a
<Response [401]> {"detail":"Invalid token."}
If I use the token from my logged in browser session I have a good response.
What I'm missing?
I cannot found the API documentation.
Thanks.
The text was updated successfully, but these errors were encountered:
Hi, you need to login to get the token. Here is the Ruby example:
#!/usr/bin/env ruby require 'json' require 'net/http' uri = URI.parse('http://localhost:8080') http = Net::HTTP.new(uri.host, uri.port) headers = { 'Content-Type' => 'application/json' } data = { username: 'admin', password: 'admin' }.to_json response = http.post('/api/v1/auth/login/', data, headers) token = JSON.parse(response.body)['key'] headers = { 'Authorization' => "Token #{token}", 'Content-Type' => 'application/json' } response = http.get('/api/v1/certificates', headers) pp JSON.parse(response.body)
Sorry, something went wrong.
Yes, I know I can use the username/password login to bounca.
Then what is the purpose of the function of generating an auth token?
No branches or pull requests
Hi,
I generated an app token, but I cannot use it.
I use it with:
curl -v -X GET http://<my_server-Ip>api/v1/certificates -H 'Authorization: Token <MY_TOKEN>'
and also in python:
but I always have a
If I use the token from my logged in browser session I have a good response.
What I'm missing?
I cannot found the API documentation.
Thanks.
The text was updated successfully, but these errors were encountered: