New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flutter Web is not supported #16
Comments
The Web Platform is not currently supported, and I don't currently know of any way to register & capture a callback scheme that would work. Do you know how that could be implemented? |
I am just starting out with Flutter, and haven't even tried working with it for web at all yet. But usually on the web, an authentication flow would just simply redirect your browser window to the authentication URL on the 3rd-part website with some parameters. The 3rd-party link will be responsible to redirect back to your website with some additional parameters (for ex: an access token) or some cookies. Wouldn't a simple |
@eldadfux since the current API of this module is In another product that I'm working on we have solved this by presenting an iframe on the Web Platform, which does the authentication flow and then redirects to a page that calls |
Can you please share a sample code, would be very useful ! |
Host a small html file containing something like this:
Say that this is hosted on e.g. Then in your app:
If you need any data from the server just send it in the message that you are posting. |
You can just use a popup 🙃 |
Would also be great if we were able to use it on Windows ^^ |
@Ionys320 I suggest creating a new issue for that since tracking web progress is not related to tracking Windows progress. |
I needed this functionality for the Web platform, so these are my findings. I have discussed several alternatives to open authentication URL in an embedded browser (ASWebAuthenticationSession / Custom Tabs):
When an authentication URL is opened in a new window it's necessary to capture and delivery the callback URL to the running application. I don't know if there is another option than insert into the project's web folder some script to do that. There are several options to transfer data between tabs, <!DOCTYPE html>
<title>Authentication complete</title>
<p>Authentication is complete. If this does not happen automatically, please
close the window.
<script>
window.opener.postMessage({
'flutter-web-auth': window.location.href
}, window.location.origin);
window.close();
</script> Can send URL and with Dart code: await for (MessageEvent messageEvent in window.onMessage) {
final message = messageEvent.data['flutter-web-auth'];
if (messageEvent.origin == Uri.base.origin && message is String) {
return message;
}
} It can be safely received. I processed it all as a Flutter Web Plugin and sent it as a #77, so I will be happy for the feedback and merge. |
it doesn't work the function will never end. |
Hello, As you have mentioned in your plugin that web is supported but when I tried using the login in the web it is not working at all, kindly let me know is there any special steps which I need to follow to make it work on the web ?
The text was updated successfully, but these errors were encountered: