Hey team, I am Darshan Kumar, Sophomore at CSE Dep...
# talk-kratos
h
Hey team, I am Darshan Kumar, Sophomore at CSE Department IIT Roorkee, I am trying to implement OIDC Flow in my application ussing kratos GO SDK (self-hosted) but faced this error where I need to redirect my browser to the following uri, but I'm unable to find any method to redirect browser in the SDK.
the method which I used from the SDK, I'm using kratos v0.10.0
SubmitSelfServiceRegistrationFlow method is throwing me error
Cc @tall-keyboard-87198
cc @wonderful-lamp-2357
@proud-plumber-24205
p
Hi @hallowed-machine-21324 You need to render the HTML form with the login / registration fields and pass it on to the browser. Then set the form action to the action provided by Ory. Allow the OIDC button to submit the form with its value - Ory will then redirect the user to the OIDC provider.
h
but I am posting the request through SDK, my frontend will not post the request to the kratos directly, it'll POST to my backend infra then my banend infra will post it to the kratos via its go sdk @proud-plumber-24205 @bland-eye-99092
my form will trigger these endpoints
and in these functions there exists go client SDK which will send req to kratos
like I wanna know how you guy's redirect the browser using SDK
@steep-lamp-91158
p
but I am posting the request through SDK, my frontend will not post the request to the kratos directly,
please don't do this. if you are writing a browser application (even if it is rendered by the server) then the browser needs to submit the flow due to the use of cookies and csrf protection. You should: 1. Create the flow in the backend 2. Render the UI from the server (go templates for example) 3. Have the UI (in the browser) submit the form (native submit) 4. Ory will redirect you back to the designated URL (e.g. your server) 5. Handle any errors on your server -> repeat step 2 - 4 6. Success! the server now renders the protected page.
Also please refrain from pinging us constantly, it is not respectful to do so. We always try be helpful in the community, but we cannot always assists all the time. Most of the documentation https://www.ory.sh/docs/welcome already describe how to do this perfectly and if you really are struggling then I would advise you use the the Ory Network https://console.ory.sh/. We also prioritize support for Ory Network customers in the #ory-network channel. Thank you for your understanding 🙂