Grails: Protecting REST API with OAuth2.0

I am creating a REST API using Grails. I want it to be protected using the OAuth2.0 client_credentials (grant_type) stream. My use case is as follows:

an external agent will send a request for something like

http://server-url/oauth/token?client_id=clientId&client_secret=clientSecret&grant_type=client_credentials

and get access_token. Then my URL (protected resource) should be accessible with something like

http://server-url/resource?access_token={access-token obtained before}

I am looking for something that makes it easy and fast on Grails. What would be the best way / tool / plugin for this? Scribe library is an option, if there are any tutorials for my specific use case, this will be great.

PS: I tried spring-security and its related plugins, without joy. Any alternatives would be good.

+5
source share
3 answers

. Grails, oauth, , oauth. Grails, , .

https://github.com/adaptivecomputing/grails-spring-security-oauth2-provider

, , , , ( authorization_code), client_credentials . , !

+2

, Scribe OAuth 1.0 OAuth 2.0. , OAuth 2 , , HTTP-, - . , .

OAuth 2.0 Java ( , Groovy), . . , HTTP- ( , , GET), . , JSON , . org.json. , HTTP-, .

, . HTTPS, HTTP- GET HTTP GET .

, , , , . , . , , .; -)

-1
-1

All Articles