Calling LinkedIn REST API from server only - oauth-2.0

Using org.pac4j.oauth.client.LinkedIn2Client & org.pac4j.oauth.profile.linkedin2.LinkedIn2Profile java libraries v 1.5.1 on google app engine I'd like to call some of the job api's from linked in.
I've successfully created my keys and have some code based on the unit tests, however I don't understand how the oAuth flow works when it's server to server (I think term may be 2-legged) and there is no browser client and need some help.
Thanks!

Related

How to expose my web application REST API using spring cloud data flow local

Looking for help on my below query.
I have a web application with 2 REST API and i want to deploy this application to Spring Cloud Data Flow local server. When other application in the local server calls this API, i want to execute my methods.
I tried below option and it didn't worked.
a) register my web application as app
b) created a task using the app in step(a)
c) created "HTTP|LOCAL-SERVER" stream and deployed
d) accessed REST URL using postman
e) my REST API call is not initiated as i cannot see any logs neither in the SCDF log nor application logs.
Thank You.
Have you checked http-client processor?
That appears to solve your use case (if I understood your requirement correctly).

Getting a webservice to use a certificate

the title might be a bit off but I really didnt know how to put it in a title.
The situation is as follows.
There are 3 applications.
1. A stand alone windows application
2. A webservice that runs in IIS
3. A REST server
Our users work with the windows application(1).
The REST server only allows calls by using our client certificate, we want to prevent that just anyone can do calls so we added another layer by letting people do a call to our webservice (2) which then does the call to the REST server(3).
We have 2 versions of this webservice, one is standalone, the other is running in IIS. When we use the standalone version it all works fine, but when we use the IIS version we get an error
REST Request failed: Unspecified certificate from client.
I assume that the client certificate that was installed is not accessible by IIS and i've been searching on google without result so far.
Basicly I am looking for a way to install the certificate in such a way that the webservice will use this certificate when making the call to the REST server.
Any help on this would be much appreciated.
The windows standalone application is made with Delphi, so is the webservice.
If there is additional information required please let me know and I will provide what I can.
Thanks in advance
Q: By #mjn "Can you provide more details about how your IIS application is coded? (coded in Delphi? which HTTP client library? How does the actual HTTP request code like like?)"
A: Yes it's coded in Delphi, for the request I used a class that uses the delphi component TRestClient
Example of a request:
Call to the request:

Box.com Service Account access

All box.com's api's read to require OAuth 2.0 using only Authorization Token grant types. I have a back end system that needs to upload a file to a box.com system. However, I do not understand how a back end system is suppose to integrate, when the authorization flow requires user "approval" to get a token.
Anyone ever done this? I am attempting to integrate a java mule app. I attempted to use the components, but they plain do not work at all, they break the entire anypoint studio. Now I am trying to utilize the http component to make the call but I am losing my patience with it.
please help, I am pretty much ready to drop kick this laptop and live in the woods.
Integration with public online API requires a little study, a little coding, and a little testing. I'm not saying it's easy. Take a look here at a Mule component I've recently created that communicates with Toggl, an online timekeeping service.
https://github.com/ciwise/toggl-api-connector
Your question requires a lot of discussion but it's best answered with example. If Box does not provide a Mule component, you can create one yourself.
The HTTP connector is not going to authenticate or perform any operations at Box for you. The HTTP connector provides the HTTP endpoint (URL entry and browser return). To authenticate your application with Box and call API operations, you'll need to do some work.
This is the high-level recipe for my solution with Toggl service (example)
Update your Anypoint Studio with Mule Connector DevKit software
Create an Anypoint Connector project in Anypoint Studio (Eclipse)
My connector provides multiple methods to process and these are used with different instances of the component (connector) in my use flow.
My TogglDataAPIHandler.java makes various checks to see if the application (Mule) is authenticated before making calls to the Application Programming Interface (API). The API is provided by Box so that developers (people writing code) can communicate with the service outside of the web browser. There's no simple answer here. You will have to do some coding. My component/connector is only an example of one way to do this (communicate programmatically with the API).
Build and install the connector(component) locally so that we can see it in the Mule Design Palette.
Drag as many of our new component (Anypoint connector) as needed into our flow canvas.
Test the flow.
I hope that helps. Take a look at my Github repo and Mule Connector. There's a wealth of information in anyone's code. But, integration with an API requires code. You can also search the Exchange for a Box connector. If you find one, then your life is simpler. You still need to read this thoroughly:
https://docs.box.com/docs

VerifyAccess through Javascript

I am currently creating a system basically consisting of mainly three parts. There is one authorization server and one resource server. Furthermore, I have one pubsub api based on Node.js (Javascript) next to it. The authorization server and resource server are built using the DotNetOpenAuth libraries. The resources can be accessed by means of the token received from the authorization server.
Now, what would be the preferred way of working when I also would like to have the pubsub api authorized by means of the same token? In the DotNetOpenAuth library, I have this VerifyAccess method available which does this for me but I don't have this in my Javascript. Would it be proper to have a separate web service doing the verification which i then call from my javascript?
Thank you in advance...
Having your Node.js call via web request to .NET to call VerifyAccess would certainly be the simplest. Alternatively if Node.js has the ability to perform asymmetric signature verification, and both asymmetric and symmetric decryption, then theoretically Node.js could validate the token directly. But that would be left as an exercise for the reader. :)
If you do accomplish it, please publish your result for others though.

How to programmatically obtain OAuth2 client credentials for Google API

I'm trying to create a redistributable web application that will integrate with Google Analytics through the Google Reporting API. Customer will install the application on their server.
I'm following this tutorial (I'm using PHP, but I believe this is not of importance for my question)
https://developers.google.com/analytics/resources/tutorials/hello-analytics-api
This works fine. No issues there.
However I can't figure out one missing element:
The tutorial starts with sending me to the Google APIs console where I have to create and configure a new API project and create and configure a client ID.
That's a lot of work that requires fairly technical knowledge (redirect url, selecting correct API, error-prone copy-and-pasting, etc.)
So my questions:
Is there an API so I can programmatically set this up for my user?
If that's not possible, is there a more user-friendly way to obtain Analytics reporting that is future-proof? (I noticed they are currently deprecating a few older APIs)
Unfortunately that's AFAIK not possible.
You could go one of the following ways:
Move client_id and client_secret to some configuration file and help your customer with deployment.
Show a one-time setup wizard for your app and guide your customer step-by-step. There you can at least provide him with the right callback URLs.
Regard your application as "installed application" and instrument curl or something similar for sending the requests.

Resources