I would like to work with Google's .NET API while using OAuth 2.0 flow for devices.
I didn't find any way to use GoogleWebAuthorizationBroker or Create UserCredentials object in .NET when working with OAuth 2.0 flow for devices.
Is there a way to make the above requirement work? or should I use only REST API?
Thanks,
Ronen
Assuming you refer to this flow: https://developers.google.com/accounts/docs/OAuth2ForDevices, it is not supported in the Google APIs Client Library for .NET. So you need to build it yourself though you may be able to reuse large parts of Google's stuff.
Notice that the "OAuth 2.0 flow for devices" is not a standardized OAuth 2.0 flow, so support is not ubiquitous. Also, the Google says elsewhere:
If your app will run on devices that do not have access to a system
browser, or devices with limited input capabilities (for example, if
your app will run on game consoles, video cameras, or printers), then
see Using OAuth 2.0 for Devices.
If that's really your use case you should pursue my suggestions, otherwise you should switch to https://developers.google.com/accounts/docs/OAuth2InstalledApp (see the flow chart on the right side there as well).
The .NET client library for Google APIs supports OAuth 2.0 and it supports several devices including Windows Phone 8.1 and Windows Store applications.
The OAuth 2.0 documentation (including snippets) is available at: https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth.
My obvious recommendation is to use the library, because it will refresh tokens for you automatically (using the stored refresh token) and it's a light OO library which will do a lot of "magics" for you (such as media upload).
By the way, our samples repository includes full sample for a universal app, take a look at Blogger.Sample for more details.
Related
I am currently implementing a TV app (basically for Samsung and LG TVs) that should display videos and images from my Google Drive account. I am using OAuth 2.0 for TV and Limited-Input Device Applications to get access to the Google Drive API: https://developers.google.com/identity/protocols/OAuth2ForDevices.
Because of the fact that only the scope "https://www.googleapis.com/auth/drive.file" (View and manage Google Drive files and folders that you have opened or created with this app) is available for this OAuth 2.0 flow, it is not possible to access any videos or images that I have uploaded with another app (e.g. Google Drive web app).
If a try to use the scope "https://www.googleapis.com/auth/drive.readonly" (See and download all your Google Drive files), I am receiving the error "invalid_scope".
Is there a way to share videos and images with an app to make them accessible for scope "https://www.googleapis.com/auth/drive.file"?
Why are publicly accessible files not accessible for scope "https://www.googleapis.com/auth/drive.file"?
Is there any way to use the scope "https://www.googleapis.com/auth/drive.readonly" for the mentioned OAuth 2.0 flow?
I would be happy for any help.
I found a solution that I would like to share.
I could solve this issue by using OAuth 2.0 for Web Server Applications (https://developers.google.com/identity/protocols/OAuth2WebServer) (which allows the scope "https://www.googleapis.com/auth/drive.readonly") and by simply adopting the flow for OAuth 2.0 for TV and Limited-Input Device Applications (https://developers.google.com/identity/protocols/OAuth2ForDevices).
This solution is quite complex, because the enitre OAuth 2.0 flow for exchanging the access token has to be implemented on your own and you have to make sure it is protected and secure. In the end it will work, but it will cost a lot of effort.
Here is a link to my final solution: http://gd.msx.benzac.de.
I have searched a lot these days trying to understand the recent changes happening to the Instagram API. I had in mind that there is some sort of an API that allows you to manage your account (posts/followers etc.) using an application other than the official mobile and web apps (connected via Oauth 2.0). Is there such a capability?
I am creating a web portal that controls the devices (like switching it on/off), visualize the data sent by those devices(endpoints). I have generated a java sdk. Do i use that sdk in my web portal or is it just for a device that sends telemetry data?
It is desirable to use generated sdk only for device that sends telemetry data.
There is no point in attaching sdk to your web application, as far as this part of the system doesn't treated as endpoint. It is bad practice to include endpoint sdk into the places, where lion's share of functionality would be ignored.
Per this announcement by Google this week: http://googleenterprise.blogspot.com/2013/11/third-party-apps-now-easier-to-find-and.html Google now supports OAuth 2 for App Marketplace apps, but the examples are all Javascript, we currently have a server side flow and I am wondering if this will still be supported and if there are any examples yet available?
Thanks!
The new Google Apps Marketplace experience fully supports using Java for your server-side authorization flow. You can use the Google APIs Client Library for Java to make authenticated calls like you would for any other Google APIs integration.
We're actively working on improving our documentation so any feedback would be appreciated.
1.How to programmatically connect with QuickBooks Online using .NET? We followed the below article but this needs manual intervention to connect.
http://ippdocs.intuit.com/0025_QuickBooksAPI/0010_Getting_Started/0020_Connect/0010_From_Within_Your_App/Test_the_In-App_Connect_Flow
Initially we developed the sample application using the code:
https://github.com/IntuitDeveloperRelations/IPP_Sample_Code/tree/master/QuickbooksAPI/DotNet/WebForms%20application
2.Which type of integration method we have to use Json or .NET SDK library? Most of the Json examples are code fragment only, Where we can download the sample application using Json with .NET
You cannot connect to Quickbooks APIs without manual intervention as it is a part of the 3 legged OAUTH flow.
The .Net SDK supports XML and JSON. There is no separate JSON library. The sample app for Dotnet in v3 is not yet available. Please refer to the docs for generating the JSON requests.
https://developer.intuit.com
If you want to create SaaS application and want to publish it in Appcenter then you need to implement OAuth flow which needs user's input for authorization. In the dev env, using the above sample app, you can get the OAuth tokens(consumer key, consumer secret, access key and access token) which you can use in your app to call all API endpoints.
https://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits/0150_ipp_.net_devkit_3.0/0002_synchronous_calls/0001_data_service_apis#Step_3:_Build_the_ServiceContext
FAQ - https://developer.intuit.com/docs/0025_quickbooksapi/0058_faq
.Net V3 Link - https://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits/0150_ipp_.net_devkit_3.0
But Intuit Quickbooks API(V2/V3) are only for SaaS app. If you want to create some custom solution for one company then you should use QBSDK.
Ref -https://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits/0250_qb
Thanks