Hey everyone! I need to tap into your collective w...
# talk-hydra
s
Hey everyone! I need to tap into your collective wisdom - I’m passing a state parameter to the authorization url and it’s not being returned when the callback url is sent. It works when I use auth0 and it’s the final step to porting over to Ory - I’ve read the docs and clicked through the console but can’t figureout what I’m missing.
Copy code
<https://festive-hoover-4ujerwwopc.projects.oryapis.com/oauth2/auth?client_id=><redacted>&code_challenge=<redacted>&code_challenge_method=S256&redirect_uri=http%3A%2F%2Flocalhost%3A5173%2Fauth%2Fcallback&response_type=code&scope=openid+email+offline_access&state=eyJ1cmxUb1JldHVyblVzZXJUbyI6Ii8ifQ%3D%3D
Any thoughts on what I’m missing?
h
No, the state parameter should be there. Maybe the special chars (%3D) are causing a problem?
s
Thanks @high-optician-2097 for the quick reply. I was base64 encoding that parameter but since updated it to use base64url to remove characters like
=
but that doesn’t seem to have fixed the issue. Regardless it seems to be working with auth0 which makes me suspect I’ve got my Ory config incorrect somewhere. To take the user to the Ory login ui I have been setting the path in the authorisation url to
<https://festive-hoover-4ujerwwopc.projects.oryapis.com/ui/login>
if I leave it as
<https://festive-hoover-4ujerwwopc.projects.oryapis.com/oauth2/auth>
it redirects me to the welcome ui
<https://festive-hoover-4ujerwwopc.projects.oryapis.com/ui/welcome>
which I don’t want it to do. I thought maybe I was meant to set the query param
prompt=login
but that doesn’t seem to do it. I think I’m missing something. Any clues as to where I’m going wrong?
h
If you have a reproducible case can you share that on github?
s
Can do - I’ve extracted the important parts from my app into this example repo, instructions for getting it going are in the
/README.md
https://github.com/ImaginateWayne/SvelteKitOryExample