set up oauth2.0 key for google api - google-app-engine

I am trying to run the sample application of DrEdit given in the Google Drive API page on my appspot domain. I am unable to do it.
I am confused on how to create the key for the web application. What should be filled in the "Web origin" and what should be filled in "redirect_url".
If i put "http://www.my-domain-name.appspot.com" in both the fields to generate the key. It gives a redirect_url mismatch error.
The redirect_url created in the older google api website is different because it creates a redirect_url of "my-domain-name.appspot.com/ouath2callback"(I haven't put www as i don't have enough reputation :p). i am confused on what to be put in the respective fields while creating the key.
Please Help.
Thanks,
Gaurav

You need to have "http://www.my-domain-name.appspot.com" registered as a redirect URI on API Console.

Related

How to solve: This URL is already in use by another Google service (Sites Google)?

I have just verified the custom URL for my Sites Google. When I want to assign it, it says, "This URL is already in use by another Google service." Meanwhile, I don't remember using the URL for any Google service. I just verified it with Google Webmasters. Anyway, I use Plesk for my domain services. Any help?
This is my site: https://sites.google.com/view/alvisyhrn/home
This is my URL: www.alvisyahrin.com
Your help will be much appreciated.
Thank you.
I use Google Domains but was running into the same error message. This post suggests creating and then deleting a synthetic redirect record (e.g. www.alvisyahrin.com -> http://google.com) in Google Domains. This displayed a "All resource records in this synthetic record will be deleted." message before deleting, and seems to have done the trick, since as soon as I deleted the synthetic record Sites was willing to use it as a custom domain.
I realize you're using a different registrar for your domain, but visiting your site now it looks like you managed to get things working (I assume by doing something like this). Hopefully this will be a helpful breadcrumb for Google Domains users that run into this, at least.

Salesforce[Web Tab]: how to authorize user

I have created Web Tab in salesforce with url of my application. When someone opens that tab and my application gets call, How can I make sure where user who opened it is authorized?
I know I can pass {!User.Email} and other variables to my app to identify user. I guess some sites also send {!Api.SessionId} but I can not find any information about how to authorize using Api.SessionId or any other variables that can be passed.
Update
I found https://developer.salesforce.com/page/Single_Sign_On_for_Composite_Apps which is guide to the question I asked. But not able to find jar for given java classes.
You can use the API SessionID and ServerURL to make a request back to Salesforce via the API. Say with the PartnerAPI. This will confirm that the user did indeed come from a valid Salesforce session. You can confirm other details, such as their email address from the active session as well.
Alternatively, you could create a newer connected app using signed requests. Here the request posted to you app will be signed with using a secret that you can decrypt. This ensures the details haven't been faked or tampered with.
Rather than creating a Composite App you can create a Canvas App. This is a type of Connected App. You can find instructions for setting this up at Creating a Connected App. The Signed Request is POSTed to your web app. See Signed Request Authentication

Why can't my Google App Engine Instance ID include the word "admin"?

I was trying to create a new app instance that would be used for the admin site of a site I'm building. When I entered "myappadmin" in the Application Identifier field on the Create an Application page and clicked Check Availability, I received a "Sorry, 'myappadmin' is invalid." message. Is that a bug or a limitation? Or am I just doing something wrong?
admin is not a restricted word for AppEngine Application Identifiers. I've just tried admin-a and it worked. Just try to use a name with -.
According to this old Google Group thread, App Engine IDs share a namespace with Gmail accounts. That would explain why so many IDs cannot be used.
appids must be globally unique within google including existing appids but also email addresses. If it's not available then there is an account/appid that matches what you are trying.

How can I reset the domain-verification process in Google Apps for Business?

As part of my App Engine application, I decided to configure an already-purchased custom domain name that would point to the app. To do this, I was directed to use Google's Apps for Business product.
Unfortunately, verification of the custom domain went bad, which was a surprise, because Google contacted my domain registrar directly. A week passed, and the domain was still listed as undergoing verification.
Is there a way I can restart the process, and hopefully complete it by a different method?
Have a look at this page:
http://support.google.com/a/bin/answer.py?answer=96917
Click on the first radio button ("I'm receiving the message 'This domain is already in use.'")
Toward the bottom of the page, there will be a URL template:
https://www.google.com/a/cpanel/<your domain name>/VerifyAdminAccountPasswordReset
Sign into your Google Apps account, then substitute your domain name in the above URL-template where indicated.
When you visit the resulting URL, Google will ask you for an email address. You will then get an email supplying data values for a new CNAME record you can add at your domain-registrar's website. If you do that correctly, Google will then consider your custom domain as verified.

Connecting to Prediction API from Google API Consol using service account

I am trying to use the Google Prediction API for the first time.
I am just following the steps given in the article https://developers.google.com/appengine/articles/prediction_service_accounts.
I am getting a strange problem while executing step 2.4 in the above mentioned article.
I have followed the steps as below.
1) I have an application created in say xyz.com domain, and I have service account name of my application as "myapp#appspot.gserviceaccount.com".
2) Then I went to "Team" tab on the Google API Console, and tried to add the service account name of my application, to the project in which I have activated Prediction API and Google Cloud Storage.
While adding the serivce account to the project it gives me an error saying that
"Only users in domain xyz.com may be added to the project".
The same kind of message is also displayed on the bottom of the "Team" tab.
xyz.com is the domain in wich my application is deployed.
Could any one please help me understand why this kind of message is comming?
Are there any domain level admin settings required to add the service account to the Google Console API project?
Regards,
Nirzari
Currently, if you created a project with your Apps account, you can only add members of that same domain.
What you'll have to do is create a new project from something like xxx#gmail.com account (NOT your Apps domain account). You can then add both #appspot.gserviceaccount.com and yourself#xyz.com.
I think you can even remove xxx#gmail.com later on, once you've added yourself#xyz.com. Even activate billing for yourself#xyz.com, not xxx#gmail.com, if you need to.
Take from https://developers.google.com/appengine/docs/python/googlestorage/overview
You can modify the ACL of the bucket manually:
An alternate way to grant app access to a bucket is manually edit and set the bucket ACL and the default object ACL, using the gsutil utility:
Get the ACL for the bucket and save it to a file for editing: gsutil getacl gs://mybucket > myAcl.txt
Add the following Entry to the ACL file you just retrieved:
<Entry>
<Scope type="UserByEmail">
<EmailAddress>
your-application-id#appspot.gserviceaccount.com
</EmailAddress>
</Scope>
<Permission>
WRITE
</Permission>
</Entry>
If you are adding multiple apps to the ACL, repeat the above entry
for each app, changing only the email address to reflect each app's
service name.
Set the modified ACL on your bucket: gsutil setacl myAcl.txt gs://mybucket

Resources