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
Related
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.
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
Question
Can anyone point me to a step-by-step example which explains how to get started with the Google Contacts API and shows a complete working demo?
Preferably in Java, but it can also be in C#, Python or Ruby.
Goal
All I want to do is to
load an existing contact,
add it to a group and
save the contact back.
Problems
I am pretty much failing on every level.
Can't get the authentication to work
Can't find the libraries that contain the classes which are used in the code snippets I found on the Internet
Can't perform CRUD operations on an existing contact
Example
Here is some pseudo-code of what I am looking for.
import com.google.contacts.*
public class UpdateContactDemo {
public static void main(String args[]) {
GoogleContactsApi g = new GoogleContactsApi("username", "password");
Contact c = g.get("Bob");
c.addGroup("Friends");
g.save(c);
}
}
What I already did
Ok, I googled for tutorials, API examples and everything else I could think of -- and failed. I found a bunch of sources like these:
Google Contacts API v3
API Directory
Contacts Reference Guide
But non contained an end-to-end example for beginners.
My approach for C# was this one:
http://nanovazquez.com/2013/01/18/working-with-google-calendar-on-dotnet/
The code can be found on github: here
<?xml version="1.0" encoding="utf-8"?>
<configuration>
...
<appSettings>
...
<!-- GoogleAPI credentials -->
<add key="ClientId" value="{CLIENT-ID}" />
<add key="ClientSecret" value="{CLIENT-SECRETD}" />
<!-- Update the port of the Redirect URI (don't forget to set this value also in the Google API Console) -->
<add key="RedirectUri" value="http://localhost:{PORT}/Account/GoogleAuthorization" />
</appSettings>
<system.web>
...
</configuration>
</xml>
You can remove the existing Google Calendar api and add Google Contacts Api.
Give this a try.
This has Oauth implementation and works, but the code samples from the code.google.com don't.
Is the best I found so far.
I've been asked to develop a facebook application that allows users of their current system to find each other using a this facebook app. Unfortuantely their requirements are that it has to be build in ASP.NET 3.5 (Easier for their clients distribution purposes).
I am a experienced PHP developer although I have in the past used C# for windows applications. I have found a facebook api that looks suitable - http://facebooksdk.codeplex.com/. The problem I am having is that all availble examples use .NET 4.
I must admit I'm struggling to get to grips with the api and I know from the past I learn best through example. Could anyone provide a link to examples or some basic code I experiment with?
I would really appreciate any advice or input you have on the situation.
Thanks, Jason.
Update
Using the answer below and the following resource (http://osnapz.wordpress.com/2010/04/23/using-asp-net-with-facebooks-graph-api-and-oauth-2-0-authentication/) it is easy enough to make start on facebook application.
One issue I also had was the server (1&1) I was using needed proxy setting added to the web.config
Example:
<system.net>
<defaultProxy>
<proxy
usesystemdefault = "false"
bypassonlocal="false"
proxyaddress="http://ntproxyus.lxa.perfora.net:3128"
/>
</defaultProxy>
</system.net>
Until you become more familiar with ASP.NET, I would suggest integrating with the FacebookClient() rather than the more involved
the one thing you will have to understand is the difference between dynamic and using IDictionary. For C# 4.0 and up you can use dynamic, but for 3.5 you must use the old IDictionary.
Here's a good example of how to convert from dynamic to IDictionary (so you can use the 4.0 examples as a guide)
var fb = new FacebookClient("{access_token}");
dynamic result = fb.Get("/me");
var name = result.name;
Response.Write("Hi " + name);
Converts to:
var fb = new FacebookClient("{access_token}");
var result = (IDictionary<string, object>)fb.Get("/me");
var name = (string)result["name"];
Response.Write("Hi " + name);
I hope that gets you on your way as far as converting the examples.
I'm using an action filter that checks what browser version is being used on my site, if it's an older browser I put up a div at the top asking them to upgrade. I don't want web crawlers to get the div message, so I've implemented HttpBrowserCapabilitiesBase.Crawler and it looks like it works for Google, but Bing and the others don't seem to register as crawlers. Strange for a Microsoft product to not notice Bing as a crawler!
Is there some way to add user agents to the crawler property or something?
Thanks!
Edited: I'm using asp.net mvc 3, it looks like I need to user .Browser files(?). Anyone know of a comprehensive set of .Browser files out there for Bing and the rest of the crawlers?
You will probably need to update your browscap.ini file as the one shipped with IIS is probably old. You can get a new one at one of the following URLs:
http://browsers.garykeith.com/downloads.asp
http://owenbrady.net/browsercaps/
browscap.ini usually lives at: c:\windows\system32\inetsrv\browscap.ini
We're not using MVC but we do this:
Regex.IsMatch(Request.UserAgent, #"bot|crawler|baiduspider|80legs|ia_archiver|voyager|curl|wget|yahoo! slurp|mediapartners-google", RegexOptions.IgnoreCase);
More options in my answer here:
Detecting honest web crawlers