grails-plugins/grails-spring-security-oauth2-google

Name: grails-spring-security-oauth2-google

Owner: Grails Plugins

Description: Google OAuth2 Provider for the grails-spring-security-oauth2 plugin

Created: 2018-05-02 15:53:09.0

Updated: 2018-05-08 19:11:58.0

Pushed: 2018-05-08 19:16:16.0

Homepage: null

Size: 86

Language: Groovy

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Spring Security OAuth2 Google Plugin

Download

Add a Google OAuth2 provider to the Spring Security OAuth2 Plugin.

Installation

Add the following dependencies in build.gradle

ndencies {

compile 'org.grails.plugins:spring-security-oauth2:1.+'
compile 'org.grails.plugins:spring-security-oauth2-google:1.1.+'


Usage

Add this to your application.yml

ls:
plugin:
    springsecurity:
        oauth2:
            providers:
                google:
                    api_key: 'google-api-key'               #needed
                    api_secret: 'google-api-secret'         #needed
                    successUri: "/oauth2/google/success"    #optional
                    failureUri: "/oauth2/google/failure"    #optional
                    callback: "/oauth2/google/callback"     #optional
                    scopes: "some_scope"                    #optional, see https://developers.google.com/identity/protocols/googlescopes#monitoringv3

You can replace the URIs with your own controller implementation.

In your view you can use the taglib exposed from this plugin and from OAuth plugin to create links and to know if the user is authenticated with a given provider:

th2:connect provider="google" id="google-connect-link">Google</oauth2:connect>

ed with google?
th2:ifLoggedInWith provider="google">yes</oauth2:ifLoggedInWith>
th2:ifNotLoggedInWith provider="google">no</oauth2:ifNotLoggedInWith>
License

Apache 2


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.