0

My goal is for a user of my VB.NET WinForms application to be able to log into a website using Google & OAuth2, thus giving me the token that I need to make API calls.

Currently, I can successfully use a username/password combination to go through the multi-step process of getting an OAuth2 token, using the WebBrowser control in a WinForms application targeting framework 4.6.1. The basic functionality works.

Problem

Instead of logging into the website with a username/password, if I try to use Google to log in, after the pop-up windows asks me to select an account, and after I select a Google account, that windows closes and another one pops which with a red/blue circle moving, then it closes, and then nothing happens. No error message - nothing. My original webbrowser content is unchanged. It's as though nothing ever happened.

What I Tried

I made the suggested changes to improve capabilities of the WebBrowser control, which seem to work because when I visit https://whatismybrowser.com, it reports that I'm using IE 11, but according to https://whoer.net, JavaScript is disabled.

I can't use WebViewer since I'm currently constrained to 4.6.1 due to a DLL I need that requires 4.6.1 (I'm trying to get away from that ASAP).

Although you can't log into GMail etc. with CEFSharp since Google blocks it, I did a test and you can use it just to authenticate in CEFSharp - i.e. Google isn't blocking it if you're just using it to authenticate to log into another site. Unfortunately, CEFSharp is a bit of a pain about bitness, so although I could go that route if truly necessary, I'd love to make this work with the regular WinForms WebBrowser control.

Speculation

I don't know if this is happening because Google now doesn't like a lot of browsers, whether not having JavaScript is the issue, or whether something is going haywire in the normal OAuth2 flow where a redirect is supposed to occur, and that redirect isn't happening correctly for some reason.

technonaut
  • 364
  • 1
  • 9
  • Are you actually using CefSharp? If not please remove the tag. – amaitland Aug 13 '20 at 20:46
  • I'm not a VB.NET developer so can't help you with that part of your question, but I own and run whatismybrowser.com - can you tell me what your user agent is? I'd like to see why it's detecting you as IE11 - it's very likely you're just sending an IE11 user agent, but I'd like to confirm. – whatismybrowser.com Aug 14 '20 at 00:14
  • @whatismybrowser, I'm not sure if there's a bug in the new VS I just installed 2 days ago or if something else is happening but all my references just vanished entirely - I'll post that once I get it working again. – technonaut Aug 14 '20 at 10:51

0 Answers0