Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix example curl to get access_token #42

New issue

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

Open
GavIngram wants to merge 1 commit into MedAziz11:main
base: main
Choose a base branch
Loading
from GavIngram:patch-1

Conversation

@GavIngram
Copy link

@GavIngram GavIngram commented Jun 14, 2023

No description provided.

alencarsouza reacted with thumbs up emoji
```bash

TOKEN=$(curl -X -L 'POST' -H 'Content-Type: application/x-www-form-urlencoded' --data 'username=admin&password=admin' http://127.0.0.1:8000/login/access-token/ | jq -r ".access_token")
TOKEN=$(curl -L -X 'POST' -H 'Content-Type: application/x-www-form-urlencoded' --data 'grant_type=password&username=admin&password=admin' http://127.0.0.1:8000/login/access-token/ | jq -r ".access_token")
Copy link

@mr-n0cturne mr-n0cturne Jul 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me it returns "null".

Copy link
Author

@GavIngram GavIngram Jul 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What returns null?

Do you have jq installed?
Did you run the line after as well (replacing the ip address and password with your own)?

 TOKEN=$(curl -X -L 'POST' -H 'Content-Type: application/x-www-form-urlencoded' --data 'username=admin&password=<YOUR_PASSWORD_GOES_HERE>' http://<DOCKER_IP_GOES_HERE>:<DOCKER_PORT_GOES_HERE>/login/access-token/ | jq -r ".access_token")
 curl -L -H 'Accept: application/json' -H "Authorization: Bearer ${TOKEN}" http://127.0.0.1:8000/monitors/

Apologies if it seems I'm saying very obvious things that you already know - I am a n00b myself and I don't know your proficiency with docker/bash/curl.

Copy link

@alencarsouza alencarsouza Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GavIngram the command works for me.

Copy link

@alencarsouza alencarsouza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

3 more reviewers

@mr-n0cturne mr-n0cturne mr-n0cturne left review comments

@alencarsouza alencarsouza alencarsouza approved these changes

@XeroByt3 XeroByt3 XeroByt3 approved these changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /