Janrain Plugin
Dependency :
compile ":janrain:1.1.0"
Summary
Installation
grails install-plugin janrain
Description
Introduction
The Janrain plugin uses the Janrain4j library to integrate the Janrain API in your Grails application.The plugin does basically nothing more than just registering the EngageService and retrieving the configuration options from your project's Config.groovy.Prerequisites
The plugin assumes you registered and configured your application at Janrain.com and you know the basics about the Janrain API.Installation
grails install-plugin janrain
Quickstart
To get started quickly just run:grails janrain-quickstart
- Add the required Janrain config properties to Config.groovy.
- Replace the index.gsp with a default index.gsp including the embedded Janrain sign-in widget.
- Create a TokenController which retrieves the Janrain authentication information and renders it as output in the response.
EngageService
The quickstart already demonstrates how to use the EngageService to retrieve the authentication information of the signed-in user:def engageService..def response = engageService.authInfo(token)
def response = engageService.authInfo(token)response.profile.identifier response.profile.displayName response.profile.preferredUsername response.profile.email ..
Configuration Options
Janrain needs a couple of configurations options which need to be set in Config.groovy:janrain.apiKey = "<your-api-key>" janrain.applicationID = "<your-application-id>" janrain.applicationDomain = "<your-application-domain>" janrain.tokenUrl = "http://localhost:8080/<your-application-name>/token"
janrain.languagePreference = "<language>" janrain.proxyHost = "<your-proxy-host>" janrain.proxyPort = 80 janrain.proxyUsername = "<your-proxy-username>" janrain.proxyUsername = "<your-proxy-password>" janrain.connectTimeout = 30000 janrain.readTimeout = 60000
Tag Library
Janrain4j comes bundled with a JSP tag library to include the Janrain sign-in widget or sign-in link on your page(s).Include the JSP tag library in your GSP pages by including the following taglib directive:<%@ taglib prefix="janrain" uri="http://janrain4j.googlecode.com/tags" %>
<janrain:signInEmbedded />
References
If you want to integrate Janrain in non-Grails web projects (e.g. plain servlets, Spring, ..) then checkout the Janrain4j Java library.
Release Notes
1.1.0
2010-11-22- Upgraded to Janrain4j 1.1.0
1.0.2
2010-10-20- Upgraded to Janrain4j 1.0.2
1.0.1
2010-10-19- Initial release