Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Can't get authorized client with flow on flutter web #88

Open
IvanKastorsky opened this issue Dec 24, 2020 · 0 comments
Open

Can't get authorized client with flow on flutter web #88

IvanKastorsky opened this issue Dec 24, 2020 · 0 comments

Comments

@IvanKastorsky
Copy link

IvanKastorsky commented Dec 24, 2020

Error: Failed to get user consent: idpiframe_initialization_failed.


    at Object.createErrorWithStack (http://localhost:56990/dart_sdk.js:4368:12)
    at Object._rethrow (http://localhost:56990/dart_sdk.js:38289:16)
    at async._AsyncCallbackEntry.new.callback (http://localhost:56990/dart_sdk.js:38283:13)
    at Object._microtaskLoop (http://localhost:56990/dart_sdk.js:38115:13)
    at _startMicrotaskLoop (http://localhost:56990/dart_sdk.js:38121:13)
    at http://localhost:56990/dart_sdk.js:33618:9

Browser shows the window to login but throw the error above simultaneously, and don't wait the response from user.

import "package:googleapis_auth/auth_browser.dart";

var id = new auth.ClientId('APP_ID.apps.googleusercontent.com', null);
var scopes = [drive.DriveApi.DriveFileScope, drive.DriveApi.DriveScope];

createImplicitBrowserFlow(id, scopes).then((BrowserOAuth2Flow flow) {
  flow.clientViaUserConsent().then((AuthClient client) {

    print(client); // never execute this
    client.close();
    flow.close();
  });
});
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant