google auth please copy this code switch to your application and paste it there [code]

What I have to do with that code?

First, let me answer the above question…

This is useful when you develop an app on limited UI environment / Or Not web based. Example: Printer with little Lcd screen. For instance, Brother printer use this to ask u to authenticate via specific website first, then copy the code to printer, so that you can print/scan doc to google drive or vise verse.

Right, how I solve it? ...
After a long…. investigation. This is mainly affected/determined by what you put on your redirectUrl.

redirectUrl: new Uri ("myredirect:oob")

If you apply the redirectUrl assigned by google, example:

urn:oeth.wg:oauth:2.0:oob:auto

Then you will see message "blar,,..blar,.. successfully authentication".
But, Auth.Completed will not be fired.

**Using own defined UrlType will not work either. Dun know why. **

However, change your redirectURL to a valid URL (a live website) will solve the problem.
Make sure you have the valid url, plus what you have defined in google app must be identical with the one you put in mobile app.

No place to put callbackURL? ..hmmm...
Instead of using IOS app type's client Id, please change it to web-application type. (This is the trick!).

How does one do this: "Instead of using IOS app type's client Id, please change it to web-application type. (This is the trick!)." I don't see this option on my Developer Console - at least I can't find the option.

Is there any update on the issue. I am facing the following errors:
1. unsupported_response_type - when I use the Client ID for the installed apps in Google Developer console.
2. I followed one of the suggestions and used web app related client id and secret. However, the app is presenting me the redirect url (the page at this url) and is not firing the Completed Event. Instead, it fires Error event and the detail shows a 400 Bad Request !!

How long should it take to program an App, that lets the user login with google (oauth) and takes them to a landing screen. The app has only one screen to see once logged in. I am interested to know what you think as to how long it takes to build the APK so a person can login and then land on the private screen.

For installed app, you should not be adding the client_secret and token_url, because that will cause a screen to pop-up in your app to copy and past the token code. I can't get this to work despite trying all the solutions here.
The solution provided by @SuchithM does not work either, I get redirect_uri_mismatch. The only Uri required by my app is either http://localhost or *:oob. But these Uri will cause a different kind of problem.

@SweeHengCheah This is working fine for me. Xamarin Auth uses the passed in redirect URL to know when to pop out of the WebView. Google uses the redirect URL to go to after a successful login. So in theory, after you successfully login, Google looks up your redirect URL, forwards you there, then the Xamarin Auth WebView sees that you have hit that redirect URL and pops you out of the WebView.

That means you should be able to use the same redirect URL when initializing Xamarin Auth as you the one you entered in the Google Developer Console site when you created your OAuth 2 credentials (the one under Authorized redirect URIs).

I initialize Xamarin Auth on iOS like so (specifying the secret and token end point might not be necessary but does not hurt anything for me at least, also I added https://mysite.domain.net/ into the Google Developer Console site under Authorized redirect URIs):

So we now need to implement platform specific login in android, ios and w8 projects ?
Google says " [...] pushing the OAuth support to whatever browser is present on the device means the login can persist on that device [...]" but how to implement this ? https://www.nuget.org/packages/Google.Apis/ ?

Xamarin.Auth has a new versions that use the Chrome Custom Tabs on Android (which is not the same as a WebView) and the Safari controller on iOS (which again is not the same as a WebView). Xamarin.Auth is currently still working on issues with Xamarin Forms usage for this latest version though.

"This user-agent is not permitted to make an OAuth authorization request to Google as it is classified as an embedded user-agent (also known as a web-view). Per our policy, only browser are permitted to make authorization requests to Google. We offer several libraries and samples for native apps to perform authorization request in the browser."

Since google has restricted the gmail login for xamarin is not working now..

Service is blocked by google for NEW apps using EMBEDDED WEBVIEWS. Xamarin.Auth supports Native UI since version 1.4.0 (2017-03). So read, do not copy/paste text from google. We are aware of that.

I don't understand how this works. I upgraded Xamarin.Auth from 1.2... to 1.5 Alpha 15 and set UsingNativeUI to true. Now its open a external Chrome instead of using internal WebView, I can login and then ... it ends on my success page, configured in my Google Account. Whats wrong? What Xamarin understand under "Native UI"? I think not a Chrome instance?

I upgraded Xamarin.Auth from 1.2... to 1.5 Alpha 15 and set UsingNativeUI to true.

You did the right thing.

Now its open a external Chrome instead of using internal WebView, I can login and then ...
it ends on my success page, configured in my Google Account.

Here - code smell. Though no code, but it smells.

"Success page"? In new OAuth by google (actually in old too, but it was allowed) we (all of us) created Web App in google console and this was wrong. Web/Server apps are for servers where sensitive data is not that easy accessible like in mobile apps or browser apps. Success page was some web page (URL - redirect_url) which existed and was loadable by browser (embedded WebView in Xamarin.Auth). This was restriction imposed by Xamarin.Auth due to the implementation. Xamarin.Auth did not allow redirect_urls like "http://localhost/succes.html" or "some-scheme:/oauth2redirect".

With new google oauth you cannot use http scheme! Why? Browser will load redirect_url and you will never be able to parse it to get OAuth data. You need custom scheme for App/Deep linking to be "returned" to your app.

Read GettingStarted.md and light will shine. There are links to community slack channel where we (10+ people that implemented new Xamarin.Auth OAuth and myself) can help you.

Whats wrong?

Quite a bit (from your description). Read the docs, try the samples and then ask.

Problems? Yes they are, but mostly nuget related (seems that order of adding nuget packages and their version can cause troubles).

What Xamarin understand under "Native UI"?

"Native UI" is not term coined by Xamarin. It is mentioned in RFC. True it is confusing and each provider coins its own term like "Installed apps" (google). In general - you shell out to system browser (Chrome on Android and Safari on iOS) via API which has reduced surface for security reasons on Android CustomTabs (Chrome CustomTabs) and on iOS SFSafariViewController. In this out of process (process meaning your app) user does login/authentication and then returns via App/Deep link[s] back to the process (your app).

If you want "pleasure" read the RFC and other docs where Native is mentioned: