-
Notifications
You must be signed in to change notification settings - Fork 10
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
Web support #48
Comments
+1 What is the obstacle? All the dependencies support desktop and web. |
Hi @maticmeznar We have not evaluated all the changes needed to support web yet because of other priority features, so we cant speak for the effort or any blockers for this task. We welcome contributions though and would be happy to review PRs for landing this. |
I have tried to get this working. The problem with google_sign_in (used in the SuperTokens docs) is, that it was never intended to be used in a browser. Unfortunately, there is no way to get the server auth code from the var signInPlugin = GoogleSignInPlugin();
signInPlugin
.initWithParams(SignInInitParameters(
scopes: scopes,
signInOption: SignInOption.standard,
clientId: clientId,
))
.then((_) => {
signInPlugin
.requestServerAuthCode()
.then((authCode) => useServerAuthCode(authCode))
}); The problem with google_sign_in (used in the SuperTokens docs) is, that there is no way to get the server auth code. I have tried to use this to call the curl --location --request POST 'http://localhost:3000/signinup' \
--header 'rid: thirdparty' \
--header 'Content-Type: application/json; charset=utf-8' \
--data-raw '{
"thirdPartyId": "google",
"clientType": "web",
"redirectURIInfo": {
"redirectURIOnProviderDashboard": "http://localhost:51917/callback/google",
"redirectURIQueryParams": {
"code": "...",
}
}
}' and even though I have registered the
I think this might not be a problem with the SuperTokens SDK any more, but with my Google Cloud config. If I get this working, this should do it. Update: setting "redirectURIOnProviderDashboard": "null", (not
So the login seems to work, but Google still has some issues with me using the test application. |
Have you tried providing the |
|
You can give just the id_token as well.. both should not be required i think. |
Thank you, this worked. I had to get the credentials by awaiting the import 'package:google_sign_in_web/web_only.dart';
Future<Response<dynamic>> googleSignInUp(
Dio dio,
GoogleSignIn? googleSignIn,
) async {
var auth = await googleSignIn?.currentUser?.authentication;
return dio.post("/signinup",
options: Options(headers: {
"rid": "thirdparty",
}),
data: {
"thirdPartyId": "google",
"clientType": "web",
"oAuthTokens": {
"id_token": auth?.idToken,
"access_token": auth?.accessToken,
}
});
} Note, that I use the |
Would like to have support for Flutter web applications
The text was updated successfully, but these errors were encountered: