hi all: how to generate a login_challenge ?
# talk-hydra
i
hi all: how to generate a login_challenge ?
g
Hi @User , If you want to generate login_challenge on your own use below format
Base64url(sha256(code_verifier))
and Code Verifier is random string and string length will be 43-128 character long. Or You can use Oauth2 client to generate login_challenge so above method will be covered by the Oauth2 client Here is an example in golang https://github.com/yusufsyaifudin/oauth2-example-hydra/blob/v0.1.0/cmd/frontend/main.go#L86 For JavaScript or Typescript Check this https://github.com/shauryadhadwal/oauth2-oidc-client-integrations/blob/master/external-app-three/src/pages/LandingPage.js#L5 And Check this repo it has Oauth Flow using Hydra implementation https://github.com/shauryadhadwal/oauth2-oidc-client-integrations
i
thank u @User
Hi @User Thank u very much, It work
🙌 1
l
Don’t confuse
login_challenge
and
code_challenge
.
login_challenge
is just an ID of specific login request which is generated by Hydra as UUID without
-
characters.
code_challenge
is one used for PKCE during Auth Code Flow.
i
Yes. This demo shows how to construct a redirect to /oauth2/auth argument, Hydra already added this parameter when it redirect back