Hi Ory Team & Community I am currently impleme...
# ory-network
a
Hi Ory Team & Community I am currently implementing social sign in, and I do face some blockers while testing locally: • I use the
ory proxy
to develop and test on
localhost
• When
updateLoginFlow
I catch the
redirect_browser_to
argument, and use it to continue the flow. However, the
redirect_browser_to
URL to e.g. https://accounts.google.com/o/oauth2/... contains a
redirect_uri
value which points to my network instance, instead to localhost: https://SLUG.projects.oryapis.com/self-service/methods/oidc/callback/PROV_ID The network instance obviously doesn't have the appropriate cookies, and fails to continue the request. If I exchange the host manually for
localhost:4000/.ory
, I'm getting a
Copy code
oauth2: cannot fetch token: 400 Bad Request\nResponse: {\n  \"error\": \"redirect_uri_mismatch\",\n  \"error_description\": \"Bad Request\"\n}
redirect_uri mismatch seems also logically. My question: How can I test OAuth2 social providers on localhost? Is it possible in a dev project without a domain CNAME?
p
Hi @adorable-camera-99335 Have you tried using the
ory tunnel
instead of the
ory proxy
? it's part of the Ory CLI and we recommend using it since it doesn't run your application behind the
/.ory
path, instead it is treated as a side-car to your application running on a different URL. Make sure to sign in to the CLI when it asks you to, this fixes the social sign in flow on localhost. Yes to both questions, you can develop without ever needing a CNAME and yes you can use Social Sign in providers on localhost.
šŸ‘€ 1
a
@proud-plumber-24205 thank you! It looks like the redirects work now.
šŸŽ‰ 3