mulesoft / google-api-commons

Commons libraries used by Mule Google Connectors
Other
1 stars 2 forks source link

Error: Could not extract user_id from... #1

Closed ldadams closed 10 years ago

ldadams commented 10 years ago

I am getting an error with the Calendar connector which appears to be from GoogleUserIdExtractor.java.

Root Exception stack trace: java.lang.RuntimeException: Could not extract user_id from { "id": "....", "name": "Luke Adams", "given_name": "Luke", "family_name": "Adams", "picture": "....", "locale": "en" }

Looks like the userId property name is id not user_id...

Thanks, Luke

alegmarra commented 10 years ago

Hi Luke,

Can you tell us what version of the Connector, Studio and Mule were you using? Also, can you paste here the app that was executed when the error was thrown?

So far, using the version 1.2.4 of the connector, I wasn't able to reproduce the error.

Regards, Alejandro

ldadams commented 10 years ago

I added the .email scope and got past that error. My issue now is the token is not getting sent back to the flow but coming back as a download in the browser.

I will be putting together some samples and adding them today or next week.

Regarding the Google Keys to generate. Based on my reading of Mule's OAuth2 framework and Google's available client types, I am generating an OAuth2 Client for an "Installed Application -> Other". Is this correct? A Server account with JWT tokens will not work?

This application will need to run without user interaction or at least with limited user interaction to create and refresh tokens.

Thanks for you help.

josesahad commented 10 years ago

Hi Luke, The Google connectors don't include JWT support yet. There is a way to perform that using custom code, a Java transformer in charge of requesting the token from Google and storing it in the Mule Object Store with a key, which will be retrieved and used by the connector in every call (accessTokenId).

What Mule/CloudHub version are you running? This code would use internal connector / Mule classes that have changed in 3.5.0.

HTH José

ldadams commented 10 years ago

Hey Jose,

Thanks for the information on JWT and possible integrations. I will give that a shot. We are using standalone Mule ESB 3.4.2 and Mule Studio 3.5. All our connectors have to target 3.4.2. We just got early access to 3.5 runtime and are testing it out. Being behind CouldHub in runtimes has been a pain point for us in regards to connector compatibility. We are excited to see 3.5 coming to standalone.

Thanks again for the tips on getting JWT working.

Luke

On Tue, Mar 25, 2014 at 3:44 PM, José Sahad notifications@github.comwrote:

Hi Luke, The Google connectors don't include JWT support yet. There is a way to perform that using custom code, a Java transformer in charge of requesting the token from Google and storing it in the Mule Object Store with a key, which will be retrieved and used by the connector in every call (accessTokenId).

What Mule/CloudHub version are you running? This code would use internal connector / Mule classes that have changed in 3.5.0.

HTH José

Reply to this email directly or view it on GitHubhttps://github.com/mulesoft/google-api-commons/issues/1#issuecomment-38611224 .

josesahad commented 10 years ago

No problem Luke, let me know if there is anything we can help with code for that purpose.

José