Skip to content
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

add POST method for token validation requests #13

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Maxime2
Copy link

@Maxime2 Maxime2 commented Apr 16, 2024

Closes #8

README.md Outdated
`Content-Type: application/x-www-form-urlencoded` header and moves CGI parameters from `<tokeninfo url>` into request body.
If this parameter is omitted, the GET method is used.

Optional parameter `:<Authz payload>` specify a payload for `Authorization` HTTP header, e.g. `:dXNlcjpwYXNzd29yZA==` will result
Copy link
Owner

Choose a reason for hiding this comment

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

Hmm. Should it maybe be more explicit?
Something like:

[Authorization: Basic dXNlcjpwYXNzd29yZA=]

So that it will be possible to also use:

[Authorization: Bearer xyzabcd]

And check for Authorization: prefix instead of just ':'.

According to the pam docs square brackets are needed if argument include space.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, I forgot about other authorization schemes that can be used :)
Perhaps if we go with the following syntax:

:<authorisation scheme>:<authorisation payload>

e.g.

:Bearer:xyzabcd

it would be more compact and nice looking. The square brackets would be needed only if the authorisation payload includes spaces.

Copy link
Owner

Choose a reason for hiding this comment

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

IMO, it is better to be explicit.
Someone who will have to maintain the configuration would easier understand what is happening just from the first sight if the argument looks exactly as in HTTP header.

Copy link
Author

Choose a reason for hiding this comment

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

The person who have to maintain the configuration will rather be following a defined operational procedure, anyone else will just read the docs. Making it looks like a HTTP header may give a false impression that any other HTTP header can be inserted which is not true.
I have added support for authorisation scheme. Feel free to change it any way you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support POST API requests?
2 participants