Hello. Just a question to know if it’s possible. I...
# ktor
v
Hello. Just a question to know if it’s possible. I implement google auth in my backend with ktor. When I succeed the authentication, the google auth redirect to my route and after the backend send an header session to the client. The question is : when I try to authenticate with my front app in Reactjs, I want to fetch the route, be redirect to google auth and after have a response with the header but now my ktor app redirect me on my back. How Can I do to redirect my client on his app when I send the header please ? (I don’t know if it’s clear, don’t hesitate if you want some code)
1
d
I’m not sure if I understand it correctly. The problem is that you are loading something in an iframe or something? If that’s the case, maybe you can place some javascript to notify or change the parent frame. Or produce a script that generates a javascript event or something. Not sure which is your specific case
v
The problem is I call this route with an external app and the google auth redirect me on back. How Can I do to redirect on my front app instead the back like remember the first call to redirect to this url ?
d
by an external app do you mean by a desktop/mobile app?
v
Yes a desktop app in ReactJs
With this app I fetch my route /authentication and when I finish my authentication, I would like to my back in ktor to redirect me on my app, I don’t know if it’s possible
d
I’m not fully sure what most of the other people do. But some people add a http server to the desktop app, and then you redirect to a local address to notify the desktop app
and I guess that in mobile you can create an uri to open the APP
v
Hum ok thanks
But if I want to redirect in function of the call, is it possible to find the origin url and redirect to this url ?
d
usually people store stuff in the “state” parameter, but IIRC the state is handled by ktor, still you can store the stuff you need in the session or a cookie. Still I’m not fully sure if I understand your problem, so I’m saying things that maybe helpful or maybe not. I would have to see code or a diagram of what you have to fully understand the problem/your case.