Grails and OAuth

I am using the REST JSON web service that I want to protect. The service is protected by very simple Spring protection and the session is stored on the server. Therefore, before a user can access the url / api / resource, he must first log in.

I want to know how:

  • Allow registered users access to my leisure api
  • Allow registered customers with registered users access to my api application (e.g. GWT, Android, iOS). I do not want users to access my api if the client is not registered.

With a lot of googleing, I saw the OAuth concept, which has a three-way authentication method.

I use grails in my project, but I did not find OAuth support. Does anyone have any experience using OAuth with grails? Is Grails easy to use?

thanks for the help

+4
source share
3 answers

I coded the OAuth library, which is really simple and known to work with Groovy.

He is called a scribe, and you can try it here:

http://github.com/fernandezpablo85/scribe-java

EDIT

If you need to implement the OAuth provider yourself, the only library I know is the old oauth java lib .

This is not well documented, but a few examples .

+2
source

Check out this plugin:

http://grails.org/plugin/spring-social-core

https://github.com/synergyj/grails-spring-social-core

They already have 2 implementations, Twitter and Facebook! Now you just need to create your own implementation!

+1
source

Use the spring security provider plugin. Creating an oauth provider is difficult and you are in a long phase of research and development, but in the end you will get some experience that few have. Enjoy it!

0
source

All Articles