0

I'm starting to feel dumb - I simply cannot get the Google API Client to work in my VB.NET web application. I can't get beyond the Authorization stage. I'm unclear if I should using a NativeApplicationClient or WebServerClient. I don't want to be tied to SessionState (something I see in all the WebServerClient examples) and I simply want to load a refreshToken (if we have one on file for the user) or generate a URL to get authorization (if we have no token.)

Nothing seems to allow this. Honestly - It doesn't seem like the GetAuthorization function is even being run when I use:

Dim auth As OAuth2Authenticator(Of WebServerClient) = New OAuth2Authenticator(Of WebServerClient)(provider, (AddressOf GetAuthorization)) With { _
 .NoCaching = True _
}

Is there any simple documentation for ASP.NET Web Applications? I'm trying to transition from the older Google Data API - which made this simple - to the Google API Client but dotNotOpenAuth is giving me the fits.

Any help? I see some comments on VB.NET not behaving - but I've tried a C#.NET Class Library with no luck.

Thanks, Bill

internals-in
  • 4,798
  • 2
  • 21
  • 38
Bill
  • 1
  • 1

1 Answers1

0

Currently there is no sample for ASP.NET using VB.NET. But I can refer you to a sample of ASP.NET here, and a sample of VB.NET with OAuth2 is still waiting for code review, but is available here.

Regrading our use of DotNetOpenAuth, I know it's complicated and one of our main goals in the next weeks is to write our own OAuth2 library.

peleyal
  • 3,472
  • 1
  • 14
  • 25
  • Is it possible to create an Authenticator w/o using the GetAuthorization delegate. Its simply not working for me - I can generate an Authorization URL and return Access Token from the code - but I'm unsure how to transform the resulting state object to an Authenticator. – Bill Apr 09 '13 at 16:12
  • GetAuthorization delegate method need to be called. Did you take a look in my VB.NET calendar sample - https://codereview.appspot.com/7007048/patch/13001/14003? – peleyal Apr 09 '13 at 19:16
  • I have - but for some reason I can't seem to get GetAuthorization to be called. I've inserted logging code to verify its running - and I never see a result. Also - and this just might be my ignorance when it comes to delegates - when the function is run, is it in a different instance? Can I access variable/properties that have been set in the class? (I need to be able to retrieve the current User in order to retrieve a refresh token if one exists.) – Bill Apr 09 '13 at 19:32
  • You can read more about delegates here: http://msdn.microsoft.com/en-us/library/ms173171(v=vs.80).aspx. Delegate types are derived from the system.Delegate class. You can access variables and properties from the class that defines them, and they will be captured in the delegate class. Regarding your problem - Which version of .NET are you running? Are you running on Mono? – peleyal Apr 11 '13 at 14:54