Accessing "com.google.location.sample" gives "No permission to read data for this private data source" - location

The user is connected to GoogleFit sources using the scope "https://www.googleapis.com/auth/fitness.location.read". However when calling the GoogleFit API, I get status 403 with message No permission to read data for this private data source.
The request is -
GET https://www.googleapis.com/fitness/v1/users/me/dataSources/derived:com.google.location.sample:com.google.android.gms:merge_location_samples/datasets/1580313980000000000-1588098599000000000
I have found this post - Google fit permission problems
Is there any alternative to access the location using same scope?

Related

Unable to access GSuite Groups - Error Code 400

I have GSuite Service Account and My app uses following scopes (these are working fine) :
https://www.googleapis.com/auth/admin.directory.customer.readonly,https://www.googleapis.com/auth/admin.directory.user.readonly,https://www.googleapis.com/auth/admin.directory.domain.readonly,https://www.googleapis.com/auth/drive.readonly,https://www.googleapis.com/auth/drive.metadata.readonly,https://www.googleapis.com/auth/drive.photos.readonly
Now I Have to access gsuite groups, As mentioned here in api documentation : https://developers.google.com/admin-sdk/directory/v1/reference/groups/list
I Added these two scopes :
https://www.googleapis.com/auth/admin.directory.group.readonly,
https://www.googleapis.com/auth/admin.directory.group
in my already existing scopes, and I'm unable to authorise my application now.
When I try to check this via api explorer in the above link, It throws an error : 400 - Bad Request. But the strangest thing happen, it returned 200 ONCE only while trying and returned the group I created, But I'm unable to make successful call again and keeps getting error.
Is there anything I'm missing here? Any help will be really appreciated.
Thanks.
NOTE: I can access gsuite users with above scopes as well, the issue is only with the groups.
As is mentioned on the documentation, 400 error is not related to the scopes that you are using. However the explorer API information is not correct as the "Customer" field is required, You can try it typing my_customer on that field and you should get a 200 if your user has the proper permissions.
I have submitted a request to update the current documentation.

Error when trying to list Matters using Google Vault API

Anyone come across this error when trying to use the Google Vault API using the Service Account OAUTH2 method?
HttpError 400 when requesting https://vault.googleapis.com/v1/matters?alt=json&pageSize=10 returned "The user does not belong to any Dasher customer."
Is Dasher a Google internal name for Postini?
I've gone over the API and service account permissions multiple times.
Turns out I needed to add delegated credentials like so:
delegated_credentials = credentials.with_subject('delegateuser#example.com')

Cloud function authorization vs validationHandler

Found myself opening a couple of functions for access to users with invalid session tokens. The only way I could find to do that is to intercept the request using a bodyParser before Parse gets the request and removing sessionToken from the request.
Now trying to do a better job managing authorization to all functions - My question are:
can I relax the requirement that if a sessionToken is included it must be valid in any other way? Is session token validation done using a default validationHandler that can be replaced or is that done elsewhere?
to control access to cloud functions, is there anything like ACL roles? does cloud function's "validationHandler" accept only param? or can I inspect the user object as well?
Yes. In parse-server you can make sure that the sessions are valid because if you will try to run any CRUD operation with invalid session you will get http 403 error that your session is not valid or expired. You can control on the "Length" of your session by changing the sessionLength property in your parse-server app. The default is 1 year
There is no control access to cloud functions but you can check if a logged in user trigger this function by checking if the request.user is not undefined. Cloud functions can get only params in key-value pairs and those params cannot be Parse Objects. if you want to send ParseObject you can send the objectId of the parse object and then query for it in cloud code to get the full object. You can always access the user context in request.user (only if cloud code was triggered by the user). If you still want to "protect" your cloud code you can check if the calling user have a Role by query the Role DB and check if the user is contained there.

The API returned an error: Error: No access or refresh token is set

I was able to successfully log in using Google Classroom and pull the course data during the trial. This was on my local machine. Now I have moved to my test server. I can still log in via google but can no longer pull the course data. I have already updated my client_secret file (updated the appropriate endpoints) but i get the following error after calling classroom.courses.list
Error: No access or refresh token is set.
Would appreciate anyone's help. I do have Google Classroom API as one of my APIs. Not sure if it's because i'm now on a domain instead of my localhost.
Sadly, I was doing a 2 part registration. The first past, I was setting the token. When the page was submitted again with new details from the user, when I was making the call to google, I hadn't set the token.

How to generate authorization signature

My application requires the user to grant permission for getting transaction details on their behalf.
I'm using 'PayPal::SDK::Core::Util::OauthSignature' to generate the X-PAYPAL-AUTHORIZATION header but I'm confused by the url parameter.
I thought to use the API endpoint for that specific operation, which is https://svcs.paypal.com/AdaptivePayments/PaymentDetails, but it doesn't seem to work since I'm getting the same You do not have permission to get these payment details error.

Resources