I am building a new page (general use of "page", not literally referring to the node type) in my Drupal site that should only be accessible to members that have a certain permission. I have defined the routing for this in mymodule.routing.yml
as follows:
mymodule.connector:
path: '/mymodule/connector'
defaults:
_controller: \Drupal\mymodule\Controller\MymoduleConnectorController::content
requirements:
_permission: 'view mymodule entity'
This so far is working nicely, my accounts with this permission are able to view the content.
I also need /mymodule/connector
to be accessible via an ajax request from a web view app that I made, which uses the same login credentials as my Drupal site, so essentially I need external authentication to work. I have tried to accomplish it by adding basic auth to my routing as explained here:
mymodule.connector:
path: '/mymodule/connector'
defaults:
_controller: \Drupal\mymodule\Controller\MymoduleConnectorController::content
requirements:
_permission: 'view mymodule entity'
options:
_auth: ['basic_auth']
However, when testing with Postman, using Basic Auth with my user credentials, this is a 403 error.
Is something wrong with my routing? I am not sure what else it could be as I am not very experienced with authentication.