Atomx
Atomx

Reputation: 96

google api authorization error "invalid cookie policy"

I tried to use Google api but this method

gapi.auth.authorize(
    {
        'client_id': CLIENT_ID,
        'scope': ['https://www.googleapis.com/auth/drive '],
        'immediate': true
    },
    handleAuthResult);

give me an error object

{
message:
"Invalid cookiePolicy"
stack
:
"gapi.auth2.ExternallyVisibleError: Invalid cookiePolicy
at new uO (https://apis.google.com//scs/apps-static//js/k=oz.gapi.it.cWuXt0TFtAc.O/m=client/rt=j/sv=1/d=1/ed=1/am=QQE/rs=AGLTcCNBVmWsKdwnYSZ6gdBgYWDV40Vbng/cb=gapi.loaded_0:351:25)
at Object..tY (https://apis.google.com//scs/apps-static/_/js/k=oz.gapi.it.cWuXt0TFtAc.O/m=client/rt=j/sv=1/d=1/ed=1/am=QQE/rs=AGLTcCNBVmWsKdwnYSZ6gdBgYWDV40Vbng/cb=gapi.loaded_0:365:246) at Nm (https://apis.google.com//scs/apps-static//js/k=oz.gapi.it.cWuXt0TFtAc.O/m=client/rt=j/sv=1/d=1/ed=1/am=QQE/rs=AGLTcCNBVmWsKdwnYSZ6gdBgYWDV40Vbng/cb=gapi.loaded_0:368:462)
at Object..jH (https://apis.google.com//scs/apps-static/_/js/k=oz.gapi.it.cWuXt0TFtAc.O/m=client/rt=j/sv=1/d=1/ed=1/am=QQE/rs=AGLTcCNBVmWsKdwnYSZ6gdBgYWDV40Vbng/cb=gapi.loaded_0:385:55)
at https://apis.google.com//scs/apps-static//js/k=oz.gapi.it.cWuXt0TFtAc.O/m=client/rt=j/sv=1/d=1/ed=1/am=QQE/rs=AGLTcCNBVmWsKdwnYSZ6gdBgYWDV40Vbng/cb=gapi.loaded_0:641:58
at new .C (https://apis.google.com//scs/apps-static/_/js/k=oz.gapi.it.cWuXt0TFtAc.O/m=client/rt=j/sv=1/d=1/ed=1/am=QQE/rs=AGLTcCNBVmWsKdwnYSZ6gdBgYWDV40Vbng/cb=gapi.loaded_0:82:299)
at Object..hx [as authorize] (https://apis.google.com//scs/apps-static/_/js/k=oz.gapi.it.cWuXt0TFtAc.O/m=client/rt=j/sv=1/d=1/ed=1/am=QQE/rs=AGLTcCNBVmWsKdwnYSZ6gdBgYWDV40Vbng/cb=gapi.loaded_0:641:34)
at onAuthApiLoad}

How can I fix it? It should return Oauthtoken, thanks.

Upvotes: 2

Views: 3159

Answers (1)

Joona Ritva
Joona Ritva

Reputation: 143

According to this SO post you need a web server to execute Goolge Pickers. Start your webserver first either using Python's:

python -m SimpleHTTPServer 8080

or for python 3.X

python -m http.server 8080

or NodeJS webserver.

Upvotes: 2

Related Questions