google-api-client

Can't Validate Google Access Token (wrong number of segments)

一世执手 提交于 2019-12-05 13:21:21
I have very simple code directly from Google's website $client = new Google_Client(['client_id' => $CLIENT_ID]); $payload = $client->verifyIdToken($id_token); if ($payload) { $userid = $payload['sub']; echo $userid; } else { // Invalid ID token echo "error"; } I get the following error(s): <b>Fatal error</b>: Uncaught exception 'UnexpectedValueException' with message 'Wrong number of segments' in /../vendor/firebase/php-jwt/src/JWT.php:79 Stack trace: #0 /../vendor/google/apiclient/src/Google/AccessToken/Verify.php(103): Firebase\JWT\JWT::decode('ya29.GlzbAwEXTe...', '-----BEGIN PUBL...',

GoogleNetHttpTransport.newTrustedTransport() returning Null

余生长醉 提交于 2019-12-05 11:43:48
I'm trying to load Google credential from json file. So before that, I knew, we have to get the default Google transport. Ref from. But it always gives null . Is anybody faced this issue? This is my snippet: try { JSON_FACTORY = JacksonFactory.getDefaultInstance(); HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport(); } catch (Throwable t) { Utilities.writeToLogFile(Constants.LOG_ERROR_LEVEL, ".. EXCEPTION" + t.toString()); } This always ends with catch part. says as below ... EXCEPTIONjava.security.KeyStoreException: java.security.NoSuchAlgorithmException: KeyStore JKS implementation

Accessing public Google Drive folder from Android app without authenticating

江枫思渺然 提交于 2019-12-05 07:20:58
I'd like for my app to be able to read from a pre-defined shared public Google Drive folder without the user having to log in or choose a Google account. Background / Environment Using my desktop browser, I have created a public folder on my Google Drive that is set up to be public. Anyone with the link may access (read) the drive, so no authorization is required: In my Android Studio project, I have gone into File > Project Structure > Dependencies and added com.google.android.gms:play-services-drive:10.2.0 I now have the ability to create a new GoogleApiClient.Builder() . Question I have

Check whether the user is already logged in using Auth.GoogleSignInApi?

♀尐吖头ヾ 提交于 2019-12-05 05:36:33
I fount that in order to sign in the user I have to use this code: Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient); startActivityForResult(signInIntent, RC_SIGN_IN); to signout new ResultCallback<Status>() { @Override public void onResult(Status status) { disconnect(); } }); But when the user relaunch the app and he is already logged in (and no sign out before) is it possible to detect this 'currently logged in' state? Obviously, it is possible to save 'logged in' in the settings (shared preferences) of the app but is where any way to detect using google api? Here

How can I make http call to DialogFlow V2 using simple ajax jQuery?

本秂侑毒 提交于 2019-12-04 21:05:00
I have been using DialogFlow v1 before using simply jquery and it was pretty straigh forward working! Now that I have to switch to V2 I am stuck on how to keep somehow same code but just modify with the V2! I have been looking at this client library for V2: https://github.com/dialogflow/dialogflow-nodejs-client-v2#using-the-client-library But I dont wanna use Node.js I just dont want to do somthing like node server.js to run the app, also I am not sure if I can mix jQuery with Node.js. My previous code v1 looked like this: fetch(url, { body: JSON.stringify(data), // cache: 'no-cache', //

Google Places AutoComplete + Android Fragment

无人久伴 提交于 2019-12-04 20:32:43
I am a beginner on Android development and I came into a problem which I hope you can help me to solve. I'll keep it simple...i am trying to use Google Places autocompletion in a fragment...the app stops right from the beginning. My guess is the problem is when I use the method rebuildGoogleApiClient() and when I set up the PlaceAutocompleteAdapter after that. Here is my code: ( ActivityMap.java - sets up the GoogleMap and creates the fragment) public class ActivityMap extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Google Tasks API: 403 Forbidden, Serving Limit Exceeded

天大地大妈咪最大 提交于 2019-12-04 20:05:02
问题 Hello Google Tasks API team, Since a couple of days ago we've started getting "403 Forbidden" for many of our users. Can you please check what is going on? Our API console is clean, #calls are way bellow quotas. Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden { "code" : 403, "errors" : [ { "domain" : "global", "message" : "Serving Limit Exceeded", "reason" : "serviceLimit" } ], "message" : "Serving Limit Exceeded" } at com.google.api.client

Use PanoramaApi with custom equirectangular image from Assets folder

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 19:31:28
I have an equirectangular image like this: I have the image in my AssetsFolder, therefor I pass this uri to the Panorama.PanoramaApi.loadPanoramaInfo method: Uri uri = Uri.parse("file:///android_asset/panorama/equi_1.jpg"); Somehow, if I check the result.getViewerIntent, I get null as return value. My gut feeling says this could have to do with the fact that this image is not created with the google camera app, and therefor missing some meta tags, but I'm not sure. The complete code of my PanoramaActivity: public class PanoramaActivity extends Activity implements GoogleApiClient

Making calls from the Javascript client library with @Named and unnamed parameters makes no sense

二次信任 提交于 2019-12-04 17:56:48
I have a Cloud Endpoints method that looks like this: //HTTP POST @ApiMethod(name = "hylyts.insert") public Hylyt insertHylyt(@Named("url") String url, Hylyt hylyt, User user) throws OAuthRequestException{ log.info("Trying to save hylyt '"+hylyt+"' with id '"+hylyt.getId()); if (user== null) throw new OAuthRequestException("Your token is no good here."); hylyt.setArticle(getArticleKey(url, user)); ofy().save().entity(hylyt); return hylyt; } I call it from the Javascript Client Library using this: gapi.client.hylytit.hylyts.insert({PARAMS}).execute(callback); Now, if I structure {PARAMS} as

Can I receive a boudingPoly for LABEL_DETECTION results?

冷暖自知 提交于 2019-12-04 13:38:22
问题 How can this be completed with the Google Vision-API please? send image to vision-api request: 'features': [{': 'LABEL_DETECTION','maxResults': 10,}] receive the labels in particular the one I'm interest in is a "clock" receive the boundingPoly so that I know the exact location of the clock within the image having received the boundingPoly I would want to use it to create a dynamic AR marker to be tracked by the AR library Currently it doesn't look like Google Vision-API supports a