How can I Insert account my google glass using node.js -
I want to put my Google Glass account, but I can not do this.
I'm using Node.js (v0.10.31), googleapis (v1.0.11) and passport-google-oauth (v0.1.5)
Of course, I Google Mirror API on Google Developer Console and the pem file is created.
Here's the Google Developer Console setting (I tried to upload the photos I needed some levels, but.)
pkginfo.oauth.google Customer ID 670282105 ??? - One ??? Pbnh1pp.apps.googleusercontent.com Email Address 670,282,105 ?????????101@developer.gserviceaccount.com Clients SECRET jt0WiP ??? PCwXT REDIRECT URIs http://www.-----------.com:3333/auth/google/ Callback JavaScript Origins http: //www.-----------. Com: 3333 http://www.-----------.com https: // mirror-API-playground.appspot.com
.
pkginfo.oauth.glass Customer ID 67,028 ???? Qjv.apps.googleusercontent.com Email Address +6702821053 ????qjv@developer.gserviceaccount.com Public Key fingerprints e25e3a045 ???? A4e40 - Delete 822e7bda ???? E85c56 - 70ae6e7c Delete 45c7c9 - Delete
Here are my codes.
passport.use (new GoogleStrategy ({clientID: pkginfo.oauth.google.CLIENT_ID, client guitar: pkginfo.oauth. Google.CLIENT_SECRET, callback URL: pkginfo.oauth.google.REDIRECT_URL} , function (Aksestokn, refresh tokens, Profile, been) {var requires googleapis = ( 'googleapis'); Var mirror = googleapis.mirror ( 'v1'); Var OAuth2 = googleapis.auth.OAuth2; var JWT = new googleapis.auth.JWT (pkginfo.oauth.glass.EMAIL_ADDRESS, pkginfo.oauth.glass.KEY_FILE, null, // 'notasecret', [ 'https://www.googleapis.com/auth/glass. third party 'nULL); Jwtkauthorize (function (Hey, token) {if (err) clog.error ( "error @ jwt.authorize:" + e); var oAuth2Client = new OAuth2 (Pkginfo .oauth.google.CLIENT_ID, pkginfo.oauth.google .CLIENT_SECRET, 'PostMessage'); oAuth2Client.setCredentials ({ACCESS_TOKEN: tokens.access_token}) VAR parameter = {Certification: oAuth2Client, userToken: accessToken, ACCOUNTTYPE: "com.cocoa .glasshelpme ", account: profile.emails [0]. {Value:" jerry jerry "}], authTokens: [{type: tokens.token_type} {value:" realName ", value:" james jerry "}] [ Attribute: ["a", "b", "c"], userData:; Clog.error (err); Clog.debug (results);}
Pre>and I got this error message. Error: {Errors: [{domain: 'global', reason: 'invalid', message: 'invalid value'}], code: 400, message: 'invalid value'} < / Code>
thanks.
Ensure that you have reached the review team to upload your APK to MyGlass and provide them Do the exact account type that you are going to use (like com.cocoa.glasshelpme
): Before you can start using this API
You can get more information
UPDATE : Just seen that the userToken
parameter is accesstooken < / Code> are used with logic;
userToken
should be the user who was provided by the migrose when the user clicked the Youth URL.
Comments
Post a Comment