I'm tasked with integrating with a service (Terra) that implements launching a web view to log into said service. Once the user logs in, it returns a url with params I need for further processing. However, my problem is that once I'm logged in successfully, all I can do is close the web browser manually, and the url that I need can't be used at all.
I'll attempt to pseudo code this:
- Create a widget that will hit the service's endpoint to retrieve a
sessionId
and theirurl
- Receive the
url
andsessionId
- Using the
url
that we received, use url_launcher to open the web view - In this web view, log in with credentials
- Once successfully logged in and the web view is redirected, retrieve the new URL on the flutter side to process the new params.
Only the last step is a bit unknown to me and the rest is working. I'm not sure if I could use a Stream
to listen to any changes with browser's url, nor am I sure if that would work at all.
Is there any way to achieve what I need?