I am trying to make the sample works so here is the code :
Sample Code
The documentation for the installation is there:
Installation documentation
I had a little problem on the step:
Click on "API Access", and then on "Create an OAuth 2.0 Client
ID...". Enter a product name and click "Next".
The UI of the console has been upgraded probably so I use those data for the authentication in the console:
Then I run the program and it brings me to the webpage to allow the app and then i got the following error message in the console:
403 Forbidden
{
"code" : 403,
"errors" : [ {
"message" : "you are not allowed to make this api call"
} ],
"message" : "you are not allowed to make this api call"
}
My queue.xml ACL is set with the email i used to authenticate
Why don't you use the native TaskQueue-API from the GAE Java SDK? You don't need to set up credentials, connection, ... .
You can see an example on the GAE Docs - here a Pull Queue, but you can also use a Push Queue if you want (an example is also in the GAE Docs).
Which one of the examples do you want to launch on the google app engine? On your posted link are many examples available :) . Tell me if you really want to use the Google-API to access the TaskQueues.
Related
How can I create a file in google drive "appDataFolder"?
I created google developer console settings which is necessary for creating file and accessing "appDataFolder".
google developer console
Android Studio output error messages as below.
W/System.err: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code": 403,
"errors": [
{
"domain": "global",
"message": "The granted scopes do not allow use of the Application Data folder.",
"reason": "insufficientScopes"
}
],
"message": "The granted scopes do not allow use of the Application Data folder."
}
W/System.err: at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:432)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
at com.example.test1.MainActivity$3.run(MainActivity.java:131)
at java.lang.Thread.run(Thread.java:923)
Source code is
File body = new File();
body.setName(FILE_TITLE);//fileContent.getName());
body.setMimeType("text/plain");
body.setParents(Collections.singletonList("appDataFolder"));
File file = service.files().create(body, content)
.setFields("id")
.execute();
If the following line is commented out in the source code, my app can create a file in google drive
top folder not "appDataFolder".
body.setParents(Collections.singletonList("appDataFolder"));
Android Studio 4.1.2
enter image description here
Best regards.
Thanks in advance.
While from the looks of your developer console image you apear to have include a large number of scopes. The issue here is not with your settings in google developer console but rather with the scopes you have authorized your user with.
When you run your application the user is asked to consent to your accessing some of their data, this is the scope of authorization for your application. It defines what the user has granted your application access to do.
If your code only requests read only access then and you try to write to it then your going to see an insufficientScopes error message.
You need to check what scope is required of the method you are using and then make sure when you authorize your user that you are requesting that scope.
My guess is you have something like this
private static final List<String> SCOPES = Collections.singletonList(DriveScopes.DRIVE_METADATA_READONLY);
YOu need to include this scope https://www.googleapis.com/auth/drive.appdata which is probably something like DriveScopes.DRIVE_APPDATA
Remember once the scopes have been changed in your application you will need to reauthorize the user. If your storing the consent then it needs to be removed in order to request authorization again.
Hello all i am working on Jhipster on ubuntu os.
my project set up was done sucessfully.
but when trying to test apis it gives me error of authentication.
here is the error occurred while testing API. it will be pleasure if someone help me out.
Error:
rExceptionResolver : Resolved exception caused by Handler execution: org.springframework.security.authentication.InsufficientAuthenticationException: Full authentication is required to access this resource
Web Browser
{
"type" : "https://www.jhipster.tech/problem/problem-with-message",
"title" : "Unauthorized",
"status" : 401,
"detail" : "Full authentication is required to access this resource",
"path" : "/api/account",
"message" : "error.http.401"
}
In my case (in dev profile), i update the JWT token, changing to base64 in all the applications (microservice, gateway and registry), additionally, comment the old property "secret" and use the same key in all. Then test the API from the gateway correctly, without authorization problems.
jh version 5.7.1
The problem with the default configuration of Jhipster user creation.
When we create app and entity using Jhipster then it also create user authentication as their functionality.
But in my case user was not created in database which I selected during creation.
Responsible Tables:
jhi_user
jhi_user_authority
jhi_authority
So, We just need to provide details of default user of Jhipster in these tables.
Username: admin
Password: admin
make sure password is in encrypted form.
Looks like you execute your JHipster registry with authentication and your application without.
In case you didn't change your JHipster jwt secret key you have to execute your application(microservice) with next parameters:
--spring.security.user.password=admin --jhipster.security.authentication.jwt.secret=my-secret-key-which-should-be-changed-in-production-and-be-base64-encoded --spring.cloud.config.server.composite.0.type=native --spring.cloud.config.server.composite.0.search-locations=file:./central-config
You secret JWT key you could find in central-config package in application.yml file
For more details read JHipster documentation :
https://www.jhipster.tech/security/#-json-web-tokens-jwt
https://www.jhipster.tech/jhipster-registry/
I had this error when trying to login after I generated the app. The tests ran fine.
Deleting the target folder and rebuilding the whole project seemed to solve it.
You can't I know. From the docs,
Once you get a list of a file's revisions, you can download the content of any revision by calling the revisions.get method with the parameter alt=media. Revisions for Google Docs, Sheets, and Slides can not be downloaded.
But I'd like to download(pdf) different versions of the same Gdoc file based on date. From the Drive web app you can view versions and print them or restore a version to the head. Is there any way to achieve either using the API? Can you restore some version ? Then you could export the file.
I searched the internets, but couldn't find a way around this.
I'm using the java client api, which gives me this when I try to make a media get request.
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"location" : "alt",
"locationType" : "parameter",
"message" : "Only files with binary content can be downloaded. Use Export with Google Docs files.",
"reason" : "fileNotDownloadable"
} ],
"message" : "Only files with binary content can be downloaded. Use Export with Google Docs files."
}
But I can figure it out if you can answer for any other API too.
Looks like a v3 specific issue. I suggest using v2 for that particular call. See https://developers.google.com/drive/v2/reference/revisions#resource , where you will see that the revision resource contains an array called exportLinks. Within that you should find an element {"pdf":"https://xxxxxxxx"}. Make an authenticated GET on that URL.
imho, the provided libraries cause as many problems as they solve. This is a case in point where the library masks access to the v2 API, even though the v2 API is fully supported. So in your code, you will need to extract the Access Token from the drive service object, set that as an http Authorization: Bearer 4a343234we43w43w44 header, then make the two GET REST calls to GET the revisions list and then GET the url corresponding to pdf in the exportLinks.
I have been developing a Java language application.
Now i am trying to show the logged in user photograph as part of the user data, but i dont seem to get it right.
Through UserService i am getting the user id, and with the user id and my application api key, i am trying to build the image url to load it into my application.
But it isnt working.
The url i am building is : https://www.googleapis.com/plus/v1/people/{USER_ID}?fields=image&key={API_KEY}
But i keep getting the same error :
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
],
"code": 403,
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
}
I have enabled as well the following API in Google Developers Console:
Drive API
Drive SDK
Google Cloud SQL
Google Compute Engine
Google Picker API
Google+ API
Can anyone lend me a hand on this?. Sorry if i waste your time with something obvious.
Check that you're using the right value for the API key. They're under Public API access in the Credentials section of the developer console and should look like something like this: AIzaSyC2WWuM97gdij5k5uRduLFeL3LuURBvFpo - make sure it's of that form, and associated with the project you have enabled the API for.
I am using Scribe-Java to connect to Google plus using OAuth2. I am able to authenticate my application and obtain user's permission, but when I try to access anything other than userinfo, I am getting this Exception.
403
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured","message": "Access Not Configured"
}
],
"code": 403,
"message": "Access Not Configured"
}
}
I have set the scope of my application as https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/userinfo.profile and to access user's profile I am using this url:
https://www.googleapis.com/plus/v1/people/{userid}/activities/public
Can you tell me what I am doing wrong? Is there some other scope that I need to use here to access the Profile?
1) Visit the Google APIs console:
http://code.google.com/apis/console
2) Go to the 'Services' page.
3) Enable the Google+ API by switching it to On
I got the same error in PHP using HybridAuth:
I had to activate the following in the Google Developers Console in APIs & Auth -> APIs
Contacts API
Google+ API
See also the discussion at http://hybridauth.sourceforge.net/userguide/IDProvider_info_Google.html