Hi! Does anybody have an idea how hydra decide if...
# talk-hydra
d
Hi! Does anybody have an idea how hydra decide if GetLoginRequest should return skip=true or skip=false? initial problem: https://ory-community.slack.com/archives/C012RBW0F18/p1698924686528509 But it seems like everything depend on that skip parameter.
p
Hi @dazzling-london-73496 For login you need to have the Ory Project set
session.cookie.persistent: true
and you must have completed an OAuth login flow before. Kratos tells hydra how long the session is valid for by reusing the session lifespan value and if it should be remembered through the
session.cookie.persistent: true
flag. see here https://github.com/ory/kratos/blob/master/hydra/hydra.go#L93-L101
d
hm I checked it just now And I still have to login twice, even if there are existing kratos session maybe you can tell me how to configure this example: https://github.com/ory/examples/tree/master/kratos-hydra so that it wouldn't require user to authenticate if user has existing kratos session?
p
Just having a Kratos session won't skip the flow. There needs to exist a Hydra cookie, which is set when kratos accepts the login request.
So you need to login with OAuth -> then do login with OAuth again and it will skip
d
hm ok, I see is there some workaround to accept the login request somewhere in between?
we kind of want to connect third-party application to our main application (which uses kratos for authentication) so, we want to use oidc for mapping internal users to third-party application users and we don't want to force users to login twice got the idea?
p
Yeah i understand, you might be able to do the Accept Login request in your service on the backend. Kratos in this case is just doing it for you, so you'd need to implement some special logic so that kratos doesn't trigger the OAuth logic.
Kratos automatically sets the refresh=true if there is a login_challenge
d
I've tried to edit that part and set refresh=false manually (on kratos side, I have forked it) but then I'm getting null from /browser/login request and FE just stuck I guess I'm getting null because request "Accept" header is application/json but kratos is trying to redirect in that case
here if I set skip=true therefore refresh=false kratos make redirect which resolves into null response body because client doesn't expect to see it, as I understand