rafalz
❔ The built-in authentication is not working
Now, using the built-in middleware, everything works correctly 🙂
https://github.com/rafalzzz/online-store-api/pull/6/files
35 replies
❔ The built-in authentication is not working
Currently, I am checking the user's permissions in the following way:
https://github.com/rafalzzz/online-store-api/blob/df927eaa2f98f3764e2eacce800fd8ca0d79a151/Controllers/UserController.cs#L106
35 replies
❔ The built-in authentication is not working
Yes, but today I continued working on this issue and created a class that takes over the context after the "CookieAuthenticationMiddleware" and checks if the user's claims contain claims of type "Role" with the value "Admin". I have no idea if this approach is good.
https://github.com/rafalzzz/online-store-api/blob/master/Authentication/CookieAuthenticationMiddleware.cs
https://github.com/rafalzzz/online-store-api/blob/master/Authorization/AdminOnly.cs
35 replies