DotNetOpenAuth OAuth2 Linked-In Example - linkedin

I am using DotNetOpenAuth and upgrading from OAuth to OAuth2 accessing www.linkedin.com's API.
Linked-In has changed where you pass parameters like scope - it moved it to the first call when requesting the access token. Does anyone have any sample calling and setup code? Specifically, what values do you set for AccessTokenEndpoint, RequestTokenEndpoint, UserAuthorizationEndpoint, TamperProtectionElements and ProtocolVersion? Also where to set the Linked-In API Key and Secret Key? Thanks for your help.

This isn't exactly an answer but you'll find a FaceBook sample using OAuth2.
Download the DotNetOpenAuth Binaries zip file.
Open \DotNetOpenAuth-4.3.0.13117\Samples\Samples.sln.
Open the OAuth2\OAuthClient project and look at Facebook.aspx.cs
Open the DotNetOpenAuth.ApplicationBlock project and look at \Facebook\FacebookClient.cs.

Related

Here.com API format

I am pretty new to this so all help you could provide would be greatly appreciated!
I am trying to use Here.com API's and on their example page for Traffic Incidents it has this example:
https://traffic.hereapi.cn/traffic/6.3/incidents.json
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&bbox=37.586,126.969;37.477,127.106
&criticality=minor
When I go to my account all I have are:
1) APP ID
2) API Key
There is nothing labeled "YOUR APP CODE". Can someone please tell me what they are looking for? Also when I do get the right info do I replace everything AFTER the '=' sign with these ID's or do I put the data between the curly brackets?
Thanks in advance for any guidance you can give...
When we log into Developer Portal, we
Create a project
We then generate an App by clicking on Generate APP. This creates your application and shows you application authentication credentials. An APP ID is generated for identifying your application.
Next, you click on Create API Key and you get your API KEY.
This API KEY is what you will be using for all your API calls and write it wherever it says {YOUR_API_KEY} by replacing the complete curly bracket and the content inside it with your API KEY.
For Traffic API, see Traffic Dev Guide

Drive API OAuth2 with HTTPS Only

I have been studying the DriveAPI for a while now and can't seem to find a simple way to get it to work just for MY needs only...
I would like to use the DriveAPI only with just the REST API (HTTPS).
There are many things like token, clientid, apikey, secrets, etc.
All I need, is to search MY OWN GDrive files (FULLTEXT CONTAINS) and get a result from the API but I can't get it to work.
Please remember, this is for my own needs only and I would like to bypass the verification (login) window and get some kind of token, that lasts forever, so I can implement this in my own tool.
So, how can I authenticate and use the DriveAPI with just plain HTTPS?
My efforts so far:
I have already made a client ID and a client KEY for a sample project in the dashboard. I have also an Google Drive API KEY. From this point, I don't really know where and what to send.
As I mentioned in my comment, there is no "bypass" for the OAuth 2.0 authentication (that's why there is authentication enforced in the first place). Have you done any coding for this that you can share? For most REST API's OAuth 2.0 authentication is required. Your application must be able to request the token and use it to make the requests.
Google API's use Google Identity service to provide the tokens. In the following document there are many examples of how this implementation should be done in different programming languages:
https://developers.google.com/identity/protocols/OAuth2WebServer

Quickbooks API + Jupyter Notebook

I am creating a Jupyter Notebook (http://jupyter.org/) in order to pull financial data from our current accounting software (Quickbooks Online).
I've worked through Quickbook's API explorer, but cannot find any documentation related to authorization for Quickbooks API; each request that I submit via the Jupyter Notebook is an authentication error.
I was wondering if there is a simple command (e.g quickbooks.apikey = [API KEY]) that I can use to pass my API key and authenticate properly.
NOTE: I do not need this to be a production-server so I do not think OAuth is necessary - just need to pass along my API key so that I can pull down a Report locally.
Thanks!
but cannot find any documentation related to authorization for Quickbooks API;
Here you go:
https://developer.intuit.com/docs/00_quickbooks_online/2_build/10_authentication_and_authorization
I was wondering if there is a simple command (e.g quickbooks.apikey = [API KEY]) that I can use to pass my API key and authenticate properly.
Authentication is via OAuth. You need to use OAuth.
NOTE: I do not need this to be a production-server so I do not think OAuth is necessary
OAuth is necessary.

Error when accessing OneDrive for Business via graph API

I have built a asp.net app that successfully accesses o365 exchange with an App Only Token and Graph. I am now trying to access a specific user's OneDrive for Business files with the same token and a Get request similar to the following:
https://mycomp-my.sharepoint.com/_api/v2.0/drives/simon#mycomp.com/items
but I get the following error:
3001000;reason='There has been an error authenticating the request.';category='invalid_client'
Any idea what is the cause of the error?
It's possible to do app-delegated access to OneDrive for Business today using the direct API endpoint and the Sites.ReadWrite.All app-delegated permission scope in AAD. I'd consider it more "in preview" than supported, so Yina's answer is technically correct. I'm still getting the documentation for how build an app finalized, but we'll be publishing something soon.
Andrew Connell has a good blog post about how to get this setup, available here: http://www.andrewconnell.com/blog/user-app-app-only-permissions-client-credentials-grant-flow-in-azure-ad-office-365-apis
Use of the OneDrive API is possible using this same method.
App Only access to a user's OneDrive is not supported via Microsoft Graph at this point in time.

Upgrading OAuth2/OpenID2 to OpenID Connect

I'm using DotNetOpenAuth library for managing authentication.
Now google has decided to not support anymore OpenId2, I've read the documentation but I haven't understood very well how I can migrate to OpenId Connect.
Now I'm authenticating with google sending the following request:
using(OpenIdRelyingParty openid = new OpenIdRelyingParty())
{
string googleEndPoint = "https://www.google.com/accounts/o8/id";
IAuthenticationRequest request = openid.CreateRequest(Identifier.Parse(googleEndPoint));
...
So I'm wondering if I have to modify only openid.CreateRequest(Identifier.Parse(googleEndPoint)) to include REALM and Return URI to make it work.
I'm looking for example on internet about Google auth with DotNetOpenAuth lib but I haven't found anything
I ran into the same issue. For migrating to OIDC Google recommends to use the "HD" parameter, see details here:
https://developers.google.com/accounts/docs/OpenID#openid-connect
I recently created a lightweight implementation of authentication against Google OIDC and made this library open source. The code is pretty basic and gets the job done:
http://www.dominikamon.com/articles/3091/oidc-lightweight-library-for-aspnet.html
The new API works different if you want to access information such as firstname, lastname, gender. You need to get this information from Google+. Therefore you need need to setup the Google+ API (You can send up to 10000 requests per day for free)
Hope this helps.

Resources