I am looking to write a desktop/cli Java app that interacts with Tumblr. To do that I need to use xAuth. I was hoping that Spring Security could be used to here however, I can't find any supporting documentation. Can someone point me to some documentation for how to support xAuth in Java? I am open to to using a framework other than Spring Security.
The best description I've seen of xAuth is on the twitter site. You've probably found the same by searching online.
As for implementing a client in Java, one approach is to reuse the xAuth pieces of the Twitter API ME. The docs make a point of saying that the "xAuth classes are fully reusable by any other API or app, so you can use it to work with any other xAuth service, besides Twitter. So whether you are looking for just a xAuth lib, Twitter API ME provides it for you."
Related
In my Java Application I want to use Oracle Responsys to trigger individual email in response to some activity detected by my web site
Oracle Responsys is completely new for me and not able find out where to start.
I got SOAP API Developer’s Guide — Standard documentation, and trying to figure out myself. But seems to be I am not understanding the core concept of how to integrate Oracle Responsys in my application.
Please help on how to integrate Oracle Responsys into my web application? I am not able to find any Java SDK for Oracle Responsys, is there one available? If available from where I can get it?
I am not understanding the core concept of how to integrate Oracle Responsys in my application.
The "core concept" is that your application sends requests to the Responsys server's API over HTTP / HTTPS. Your application can (in theory) do this directly by crafting HTTP requests with the correct parameters / payloads / etc, and then parsing the results. Alternatively, it can use either a generic framework (such as JAX-WS), or a specific client library to do most of the tedious stuff for you.
I am not able to find any Java SDK for Oracle Responsys, is there one available.
Responsys provides both REST and SOAP based APIs, but at this time they don't appear to provide any (official) Java client-side libraries for either API.
I did find some 3rd-party client libraries on Github. Rather than listing them, I suggest that you Google for responsys api github and start trawling the search results.
Questions that ask for recommendations on StackOverflow, are off topic, so I'm assuming that you are not asking for one. But, you will need to do your own assessment of the completeness and fitness for purpose of the various library alternatives.
I'm still learning spring and currently I'm trying to create webapplication and RESTful API at the same server. It was easy until I tried to add OAuth2 authorizaton to be able to consume that API in Android application.
I have a problem because I don't completely understand what is happening under the hood of spring.
I want achieve something like this:
localhost:8080**/** - webapp authorized in normal way
localhost:8080**/login** - webapp login page
localhost:8080**/api/** -RESTfull API
localhost:8080**/oauth/[authorize|token]** - OAuth2
Android application to consume API
Is it even possible? Can you provide an example code or just the way I should do it?
Well, Spring Boot has plenty of documentation.
I'd recommend the Spring Boot manual
As for what you want, yes, it's possible.
See this demo which has OAuth, REST API and normal HTML, CSS, JS files all in one. Also, this demo is based on spring-boot, so what more do you want :)
Again, the demo url:
https://github.com/szerhusenBC/jwt-spring-security-demo/
As I said above, it's possible. Not recommended, but possible. It would be recommended to split them, for a better separation of concerns. Also for performance reasons: Apache for instance can serve static files much faster than SpringBoot/Tomcat can.
Of course you can start this way and do it later. Enjoy.
Yes! Take a look at JHipster and how they realize OAuth2. http://jhipster.github.io You can generate app and check how everything is done under the hood. You can also find many useful patterns for development.
I have already created a web project (not in google app engine) and at last wanted to integrate Googe OAuth with my existing web project.Will I be needing Google Engine Plugin for Eclipse or can it be done using just google-appengine and google-sdk jars?I have gone through many links, many of them suggest about creating a maven project which destroys my project structure.
No you technically do not need any of the google jars because OAuth is a protocol, not a program of sorts. Google jars may however simplify your application.
If you want to write it from scratch, please refer to google's website about it. This website also provides clients which, and I quote from the given link:
Note: Given the security implications of getting the implementation
correct, we strongly encourage you to use OAuth 2.0 libraries when
interacting with Google's OAuth 2.0 endpoints. It is a best practice
to use well-debugged code provided by others, and it will help you
protect yourself and your users. For more information, see Client
libraries.
I am new to Java GUI, I have knowledge of core Java.
I have to call a REST client from my NetBeans project, give values to it, and receive its output in the same project.
Please point me to some helpful resources.
This tutorial covers the basics using Twitter's REST api which should be stable enough for you to be confident that any errors you see are in your implementation and not the API.
"In this tutorial, you create a NetBeans platform application that consumes the Twitter What Are You Doing service, displaying a list of your Twitter friends' status messages. First you create the platform application. You select the libraries needed in the application. Then you create a NetBeans module. Finally, you add a RESTful client and some basic display elements to the module. The client uses OAuth authorization."
https://netbeans.org/kb/72/websvc/jersey-rcp-client.html
You could try looking at the Oracle documentation on JAX-RS clients, which is how you can access REST resources using Java.
http://docs.oracle.com/javaee/7/tutorial/doc/jaxrs-client.htm
In addition, client libraries like RestEasy and Jersey can help make your life even easier.
When dealing with RESTful webservices, you'll also want to know how the request bodies map to your Java objects. Are you using XML, JSON, a combination? It will help to know that as well so that you know if you need an XML mapping framework or a JSON mapping framework. You can just parse the strings, but depending on how complex it is, that might get really messy!
I googled a bit, but all java clients for the tumblr API were outdated, poorly written, not supported, etc.
Is there something that is up-to-date, is of sufficient quality, and (optionally) has a maven dependency? Something like twitter4j, but for tumblr.
If you're willing to also use Spring Social, I've written a Tumblr client for it here:
https://github.com/sdouglass/spring-social-tumblr
Spring Social is a great, solid library for building and using OAuth 1/2 API clients. Using it gives you the ability to just drop in support for a variety of other APIs very easily.
http://www.springsource.org/spring-social
I've included info for adding spring-social-tumbler as a Maven dependency in the README for the project, which you can see at first the link above.
I think if you want to use it, the simplest approach would be something like:
Tumblr tumblr = new TumblrTemplate(yourTumblrApiKey);
If you want to access the API on behalf of a user, you'd need to use OAuth to get an access token and access token secret for the user, at which point you could do something like:
Tumblr tumblr = new TumblrTemplate(yourTumblrAppConsumerKey, yourTumblrAppSecret, userAccessToken, userAccessTokenSecret);
If you integrate Spring Social into your project it can help with building appropriately authorized Tumblr instances, obtaining and storing access tokens/secrets for users, etc. You'll have to check their docs for more info about that. My code is designed to "plug in" to a typical Spring Social setup the same way as the official libraries like Spring Social Facebook, Spring Social Twitter, etc.
Jumblr is the official Java API for Tumblr, here is a link! And here is the documentation
You may also have a look at Temboo. Temboo offers streamlined and normalized access to many APIs, including Tumblr, via a native Java SDK.
My personal favorite reasons for using this library is how easy it makes OAuth and that Temboo lets me save API credentials in the cloud so I don't have to go through the hoops of abstracting them from my code or securing it on my machines.
You can check it out and play with it at http://temboo.com/library/Library/Tumblr
I should also note that I work at Temboo. So when you check it out, if you have any questions, feel free to message me.
You may have a look at Webshell.
They provide a simple REST API that can be used to call third party APIs. Among those apis, there is the tumblr API.
Don't forget to check out their hilarious blog : http://apijoy.tumblr.com/ :)
You can look at Jumblr library. It is very easy and powerful.