enable google map - c#

Ii have a webpage which has a map control from:
(http://www.codeproject.com/Articles/24468/Google-Maps-Control-for-ASP-NET-Part-1)
When I run it from http://localhost it executes fine. When I move it to my actual website, the page goes blank. Is this only for testing on localhost or is there anything else I'm missing. Can anybody guess what the problem is?
Is there any other way to have maps running
I am using VS2k8

For v2 of the Google maps API, which the code in GoogleMapControl.zip uses, Google doesn't check the API key when running on localhost but they do when running elsewhere. Make sure that you have a valid API key from Google and add it to the Web.config:
<appSettings>
<add key="GoogleAPIKey" value=""/>
</appSettings>
There is a comment at the top of Page_Load() in SimpleMapWithNoBubble.aspx.cs that documents this.
Regarding the version of the API, in cGoogleMap.cs:
string _apiversion = "2";
I didn't dig any further to see if the code is written well enough that you could just change to v3 but it's worth a quick try.
As noted at the valid API key link above and in the comments below, v2 of the API is officially depreciated and it's scheduled to go away no later than April 20, 2015.

Related

IBM Watson Unity SDK, IamAuthenticator objects cannot authenticate successfully

I am trying to query Watson Discovery News and get some responses in Unity.
First I tried to authenticate my Watson Discovery service through Discovery service APIKey(As described in the "IAM" section in https://github.com/watson-developer-cloud/unity-sdk). My code is exactly the same as the example code in "Query a collection" section in https://cloud.ibm.com/apidocs/discovery/discovery?code=unity#query-a-collection.
Unfortunately, the code always returns due to unsuccessful authentication, thus I cannot get any response. After some debugging, I found out that "tokenData" field in IamAuthenticator.cs(This is part of IBM Unity SDK) is not initialized; this leads to the unsuccessful authentication.
I was able to debug by changing the "yield return" in example code to "return". Otherwise, C# debugger cannot step into the code.
Since I have followed all the steps in IBM documentations, I am not sure how to proceed.
To reproduce the problem, one has to download IBM Unity SDK on https://github.com/watson-developer-cloud/unity-sdk and follow the instructions in README. After setting up, one could replicate the problem using the code below:
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
Thanks in advance for any help!
Have you set the URL (SetServiceUrl) to match the location for your service instance? See Service Endpoint in the API reference
I bypassed this problem using Token authentication instead of using APIkey.
If one has the choice of using other SDKs, e.g. Java SDK, please do so. Because Watson Unity SDK is not well supported at the moment.

googleConsumerKey and googleConsumerSecret for DotNotOpenAuth library

I am completely new to DotNetOpenAuth library and am currently trying to use it in a WebForms ASP.Net website project. I have successfully installed the library in my website using Nuget.
However, when looking at the samples for this library, I found the following 2 keys in web config. I did go to the sign-up URL mentioned, but could not get these keys. I also tried looking up the docs for this library, but could not find any thing on these 2 keys.
<!-- Google sign-up: https://www.google.com/accounts/ManageDomains -->
<add key="googleConsumerKey" value="anonymous" />
<add key="googleConsumerSecret" value="anonymous" />
Question
How do I get googleConsumerKey and googleConsumerSecret for use with my website, so I can have users login using their Google account?
It can be difficult to find, there is soooo much google stuff that they offer that sometimes the thing you want is not easy to find.
Try
https://console.developers.google.com/apis/credentials
For Capcha keys use
https://www.google.com/recaptcha/admin

How to get a developer key for ViaGogo API

Long shot, but I'd like to fiddle with ViaGogo API (C# library more precisely). ViaGogo has a well documented public API, documentation is avaliable here.
Problem is, you need to authenticated as it usually happens with this kind of APIs: usually, you find a section of the website, maybe in your profile section, where you can obtain keys, secrets and so on (this happens for example on Facebook or Amazon).
As for ViaGogo, I only found a link that points to a Google Form: this form asks for info about advertising and affiliation on a complete different level of what I need, I won't publish anything read via API. Furthermore, there's no field to leave an e-mail address.
Their C# library seems pretty popular as far as I can tell from downloads from NuGet; I wonder how all these thousands of devs succesfully called that API.
Has anyone succesfully obtained authentication info from ViaGogo?
According to note in registration form, you have to wait for 30 days for their reply.
For more help you can contact them on following contacts:
E-mail: affiliate#viagogo.com
Telephone: +442075532777
Or
http://www.viagogo.com/in/help
There doesn't seem to be any way around this registration according to their website and the api itself -- an appID and password is required. You may try your luck emailing them at Affiliate.Team#viagogo.com -- see this issue on github where the possibility of getting an account via email is discussed: https://github.com/viagogo/developer.viagogo.net/issues/24

Authorization Method on Adwords

I've just got back to working on an integration with the Adwords API, and realized it had to be upgraded (from v201109).
This was previously a prototype application, that is now scheduled to come to life, and what I've noticed is that there's been a big leap from v201109 to v201209 in terms of authentication.
By reading Takeshi's reply here, it became clear that the entire concept of sandbox has now been phased out, and we now work on the basis of having a test account.
Initially on my prototype I was only using ClientLogin as the AuthorizationMethod through a test account. However, with the new authentication I've realized I will actually have to use our actual live MCC account with a test account as described here.
All well and good, I've got the account created, and have requested permission to use it as a test account. However using the live credentials with
<add key="AuthorizationMethod" value="ClientLogin" />
<add key="Email" value="xxx"/>
<add key="Password" value="xxxxx"/>
Isn't an option... :-(
I then thought about requesting an OAuth key pair in order to use them on my application instead. All the documentation I found about getting one of those seems a bit rough around the edges, so I'm not really sure how to get one of those without actually making my application request it. Ideally, I'd like to go somewhere, generate it, and then use it on my config file as such.
<add key="AuthorizationMethod" value="OAuth" />
<add key="OAuthConsumerKey" value="INSERT_YOUR_OAUTH_CONSUMER_KEY_HERE" />
<add key="OAuthConsumerSecret" value="INSERT_YOUR_OAUTH_CONSUMER_SECRET_HERE" />
Is that even possible? If so, where can I generate the OAuth keys?
Turns out you still can use ClientLogin, but it's been earmarked for deprecation, which means Google will still support it for the next 3 or so years.
Here's a link to a conversation between Anash (AdWords API Advisor) and myself on the Google Adwords API official forum.
https://groups.google.com/d/topic/adwords-api/C-giDgpvF_I/discussion

Google-drive example: oauth2callback not found

I need a little help with the C# example program of Google-Drive...
I used this so-called "tutorial"/"example":
https://developers.google.com/drive/examples/dotnet
And the code from here:
https://code.google.com/p/google-drive-sdk-samples/source/checkout
I uploaded my (only slightly modified) sourcecode here in case anybody doesn't have Mercurial (I didn't have Mercurial and no admin rights to install it either, and Mercurial is the only way to get the sourcecode...):
http://verzend.be/elt0k13enraw/DrEdit.rar.html
I always get
"Ressource cannot be found"
Requested URL: /oauth2callback
I don't find this astonishing, as no oauth2callback controller or handler is implemented...
I tried adding a Controller called oauth2callbackController and redirecting to another action in oauth2callbackController.Index, doing
return new RedirectResult("/about/about");
But that only creates a NULL-reference exception.
So i figured, maybe the wrong controller and redirected to
return new RedirectResult("/drive/Index");
But that only creates an infinite loop of redirect -> allow -> redirect - allow -> etc.
BTW, the config to change the API key + REDIRECT_URI is in
Models\ClientCredentials.cs
Note:
The problem aren't my modifications.
The sample also didn't work unmodified, with the exact same error.
All I did was removing EntityFramwork references, and throwing "Not implemented exception" when a method using entity was called.
Edit:
Additional information:
What I really wanted to do in the first place is to write a console service that exports my database, LZMA-compresses the exported content, encrypts that with OpenPGP, and uploads the database of my server to Google drive every day at 24:00 o'clock, without any user input.
I got export working without a problem, i got the LZMA compression working without a problem, I got the encryption with PGP working without a problem.
After the end of the working day (grrrr), when I was at home, I was even able to download the example-code with the mercurial installed on my Linux-machine at home, and bring it on the windows machine using SMB...
But now I can't get the sample for the Google-drive SDK working...
And moreover, what I really need is an example for a console service/daemon, not a web-application.
When I created the API key, I saw one could create a key for a service, but there is no example on how to write a Google-Drive service (console application), and no useful documentation as well (yea there is a reference, but it's only a reference, IntelliSense provides about the same)...
When configuring your app in the API Access tab of the APIs Console, you had to set the root (/) of your web server as the redirect URI and not /oauth2callback.
Assuming that your app is published at www.example.com, just go back to the APIs Console and set it to www.example.com instead of www.example.com/oauth2callback

Categories

Resources