Closed hongooi73 closed 4 years ago
Ugh, I just noticed that you set the route in the middleware:
auth_mw = AuthMiddleware$new(
auth_backend = basic_auth_backend,
routes = "/secure/factorial",
id = "auth_middleware"
)
So nvm about the 1st question. I'd still be interested to know more about how bearer auth is implemented though.
Please consider to read https://github.com/rexyai/RestRserve/blob/master/CONTRIBUTING.md before opening issue here.
Asking Questions chat on gitter post a question on Stack Overflow using the [restrserve] tag
Just had some questions after reading the Auth article.
For basic auth I'm not seeing where the backend distinguishes between the secure and unsecure endpoints. Here is the code:
Is the "secure" in the endpoint path meaningful in some way? Otherwise, I don't see how the app knows to apply basic auth to one but not the other.
For bearer auth, it seems that you're just looking for an exact match between the presented tokens and a list of possibilities. Is it really that simple? Shouldn't there be a process of decoding and looking at the token contents?
Also, similar to basic auth, I'm not seeing how the backend knows when to apply bearer auth.