7

I have used various OAuth2.0 authentication based web application(facebook, twitter, quickbook, etc) and accessed their APIs for fetching data services. Now I am looking for developing an web based application which implements OAuth2.0 based authentication itself. User can create apps and get token and secret and other details. My programming language is Java. I could not find enough literature over the same.

Is there any library which can be used to implement OAuth2.0 authentication or any specifications which can be implemented ?

  • 1
    Should it be Java or Java script? – Undo Mar 3 '14 at 13:54
3

You can look at subscribe - scribe library fork for OAuth. I have implemented JEE skeleton for OAuth login as well that you can reuse for faster start.

  • Why downvote? He asked for resources and I gave links. Quotation: "Is there any library which can be used to implement OAuth2.0 authentication or any specifications which can be implemented ?" – Leos Literak Mar 23 '14 at 13:00
  • Probably since this is a very minimal answer; given the lack of specificity of the question though I would say it is a totally reasonable answer. That is not to say it wouldn't be cool if it was bigger but it is fine in this case how it is. (The downvote was not me) – Nick Wilde Mar 23 '14 at 14:22
2

You can take a look at ApiFest OAuth20 project - http://apifest.com. The project implements OAuth20 specification final version (RFC 6749). The project is available at github and it is released under Apache License, Version 2.0. ApiFest is written in pure Java and uses Netty as a server. It's light and fast. Currently, you can use Redis as a database or MongoDB. Note, that you can easily add another database. The project setup is easy - see the project README.md file. You can register client apps - as a response you will receive client_id and client_secret. Then you can use these credentials to obtain access tokens and use them as per your needs/OAuth20 spec. https://github.com/apifest/apifest-oauth20

  • Interesting but I did not get what mapping server is for. – Leos Literak Mar 23 '14 at 17:21
  • Mapping Server is used to map the requests your API exposes to the world - let's say GET /me to a corresponding resource in your system/platform - in that case for instance GET /customers?custId={cust_id} where cust_id will be fetched from the oauth 2.0 access token used with GET /me. – ross May 8 '14 at 19:54
1

Scribe project

Scribe is "the simple OAuth Java lib".

To quote the doc:

Configuring scribe is so easy your grandma can do it! check it out:

OAuthService service = new ServiceBuilder()
                              .provider(LinkedInApi.class)
                              .apiKey(YOUR_API_KEY)
                              .apiSecret(YOUR_API_SECRET)
                              .build();

This project claims to support all major 1.0a and 2.0 OAuth APIs out-of-the-box including Google, Facebook, Yahoo, LinkedIn, Twitter, and many more.

The "subscribe" project described in this sibling Answer is a fork of Scribe.

Vaadin OAuth Popup

The OAuth Popup Add-on for Vaadin web apps (GitHub) is open-source, so you can peruse that too. It uses the above-mentioned Scribe library.

0

For the Java Server API you can use Spring Security.

For the Java Client Application you can use Apache Oltu.

Oltu is used in Swagger codegen project too. If you API (or RestService) have swagger support. OAuth2 client can be generated with swagger-codegen-maven-plugin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.