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

Support for authorization header #64

Open
kappsegla opened this issue Feb 3, 2022 · 1 comment
Open

Support for authorization header #64

kappsegla opened this issue Feb 3, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@kappsegla
Copy link
Contributor

One standard header in HTTP requests is authorization. This can be used to provide credentials to the server and the server can then use this to authorize certain paths on the server demanding for example username and password for login. Maybe we can create a class that can handle this for incoming requests? Can also be extended with functionality for permitting and or banning ip-adresses.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication

Example, when from a client (Insomnia) using the Auth mode Basic we can provide a username and password.

basic

This results in a header:
Authorization: Basic , where credentials is the Base64 encoding of ID and password joined by a single colon :.

For username: user and password:password the following will be sent to the server which has to base64 decode the textstring and separate username and password.

authorization: Basic dXNlcjpwYXNzd29yZA==

If no credentials are available or they are invalid the server can respond with a 401 (Unauthorized) status code.

@robinkorkmaz1 robinkorkmaz1 self-assigned this Feb 4, 2022
@robinkorkmaz1
Copy link

I have provided a part of the solution in pull request #67

@kappsegla kappsegla added the enhancement New feature or request label Feb 4, 2022
@kappsegla kappsegla linked a pull request Feb 8, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants