How do I integrate google OAuth with java servlets? - java

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.

Related

How to use Oracle Responsys with Java Application

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.

Single Sign On Between .Net And Java Apps

We have legacy applications written in asp and asp.net on IIS using form based authentication against the Database (Not AD). We are writing a new Java app sitting on glassfish and we want a single sign-on solution to authenticate users so they can move seamlessly between the two without having to sign on again.
Are there any secure solutions to this problem?
I think the best approach in the long term is to decide on a SSO technology / implementation, and then change the legacy applications to use it. I know that changing legacy apps can be painful, but provided it is practical you should do it.
UPDATE
You don't necessarily have to do a complete rewrite of your legacy apps. If you can identify an SSO tech which supports the legacy language too, you can maybe just get away with rewriting the login page and (maybe) access control and/or local account management.
Take a look at spring security (if you're not opposed to using spring for your java app). They support dozens of solutions, probably whatever you're using for your ASP app. http://static.springsource.org/spring-security/site/
Alternatively you could use apache shiro http://shiro.apache.org/ which also supports just about anything out there for security.
I'd advise looking to see if one of these supports what you are using already on your legacy app, it would probably be easier to make the java app support your existing security mechanism rather than trying to backport a new security layer into ASP.

Using 2-legged OAuth with Google Tasks API in Java

I’m trying to build a Sync application for Google Task API using Java.
An additional constraint I have is to use 2-legged OAuth.
I followed the article Using 2-legged OAuth with Google Tasks API for Google Apps domain administrators but the code sample they provided for Java doesn’t compile with the latest API libraries.
Also, there is lot of material available about Google Tasks, but either its deprecated or using non existent API/references.
It would be great help if someone could point me to a relevant article or working example.
Articles and sites I referred to:
https://developers.google.com/google-apps/tasks/
Thanks
Can you explain the constraint to use 2LO? There are ways to write sync apps that use OAuth2 and tokens, which has more current library and sample support. You can request "offline" access and save the refresh token in the client. Then you can continually sync that data for the user in question. Is the reason you need 2LO that you need to do this for an entire domain of users without prompting them?
In any case, the tasks api and 2LO should be compatible even if you're having issues with some libraries. I can't comment on the state of all the samples and libraries, but if you follow the steps to approve the tasks api scope for your client_id in ManageOAuthClients and you know the ids of your domain users, and you sign your requests properly, it should 'just work'

Is there a decent Java client for the Tumblr API?

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.

xAuth for Java?

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."

Categories

Resources