Do you always have to require consent? Currently u...
# talk-hydra
c
Do you always have to require consent? Currently using a Nextjs, with hydra in the api route, and was curious if it was possible to not require the consent view
l
AFAICT, you must accept the consent request, but you don't necessarily need to show the consent UI
c
You can use something like this to accept the consent request programmatically
s
Or this for JS. Look at line 68, where it says, that you must only show the consent UI, if you cannot skip it. This means that you need the
/consent
endpoint, I think. Or did you find another way to skip it easily?
c
Yeah I'm looking at that now and just playing a bit with it.
Trying to figure out if I need to use the
hydraAdmin.getConsentRequest
Trying to figure how it would know if you can skip or not
As written here I understand that the skip value indicates if the user granted the same or a subset of the scopes that are requested in the time period of the remember_for seconds and ticked „remember this“ in the last consent screen. If the client requests previously not granted scopes or the time frame is exceeded, the skip value is false. But it is still up to you to show the consent page or don’t. I would suppose you implement a list of trusted Client IDs where you don’t show the Consent page and manage this separately or in an Env-variable. My understanding of security is not, that it would be okay to skip parts of a well defined authentication and authorization process always. But this is up to you. :)