bored-vegetable-68997
08/29/2022, 1:57 PMOAuth
and OIDC
. Still I have some key points that I am thinking about.
Lets say I'm building an API where I want to hide specific endpoints for non-authorized users. These endpoints are accessible for a client with an access token under a specific scope, right? Questions: Where are the scopes defined and where do I check if access should be granted based on the scope?
Do I have to check that in my API or could it be done via oathkeeper
?
I hope that the question is understandable.
Thanks!red-machine-69654
08/29/2022, 2:07 PMAuthorization
header (in a request) or a cookie (session) to authenticate the user (using its authorizer and a mutator). so my backend just knows, "there is a user". if for some reason the authorizer "fails", my backend doesn't even get the request.
now hydra would come in if you "authenticate" on behalf of the user, but IMO that's outside of what you describe.
i think you need a user management piece (can be kratos) and then integrate that with hydra to create tokens for the user with the scope, etc.. your backend is another concern.red-machine-69654
08/29/2022, 2:09 PMred-machine-69654
08/29/2022, 2:09 PMbored-vegetable-68997
08/29/2022, 4:25 PMKratos
as my Identity Provider and also tried oathkeeper
. But with only kratos
the oathkeeper
just checks on specific configured API routes whether a user session exists or not.
And here I was wondering how hydra
comes in place and how to check scopes of access tokens, since a scope gives permission to certain 'areas' of your API, as I understand.