[core] Implement bearer token authentication - #3043
Conversation
|
This pr reminds me of a previous issue where they wanted to use an api key in the url to access feeds. This is because their client didnt support I prefer to just put this parameter in the url e.g. Because will make it very use to just e.g. invoke curl without messing with headers. Also maybe reuse the authentication section from config? I prefer Lastly I dont think those http codes |
As result, I will keep both methods, using header and using query parameters. First one is for security, second for easy usage. |
| } | ||
|
|
||
| if (!$accessTokenGiven) { | ||
| $this->exit('No access token given', 403); |
There was a problem hiding this comment.
401 Unauthorized is the status code to return when the client provides no credentials or invalid credentials. 403 Forbidden is the status code to return when a client has valid credentials but not enough privileges to perform an action on a resource.
|
This class is not in use right now and is a useful class for protecting resources that require the use of |
This will allow to write actions, that should be authorized only by instance admin.
For example in my WIP InstagramBridge modifications there 2 actions, that use this feature.
https://github.com/em92/rss-bridge/blob/instagram-rabbitmq/actions/SetBridgeCacheAction.php
https://github.com/em92/rss-bridge/blob/instagram-rabbitmq/actions/PullJobQueueAction.php