GithubHelp home page GithubHelp logo

francoiskha / grails-spring-security-oauth2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matrixcrawler/grails-spring-security-oauth2

0.0 1.0 1.0 446 KB

Spring security Oauth Grails 3 plugin

License: Apache License 2.0

Groovy 98.37% Java 1.63%

grails-spring-security-oauth2's Introduction

Spring Security OAuth2 Plugin

Build Status Download

Main differences with the Grails 2 plugin:

Installation

Add the following dependencies in build.gradle

dependencies {
...
    compile 'org.grails.plugins:spring-security:3.+'
    compile 'org.grails.plugins:spring-security-oauth2:1.1.0'
...
}

You will also need at least one provider extension, i.e the grails-spring-security-oauth2-google plugin Change the version to reflect the actual version you would like to use.

You can configure the following parameters in your application.yml. This is fully optional

grails:
    plugin:
        springsecurity:
            oauth2:
                active: true    #whether the whole plugin is active or not
                registration:
                    askToLinkOrCreateAccountUri: '/oauth2/ask' # The URI that is called to aks the user to either create a new account or link to an existing account
                    roleNames: ['ROLE_USER'] #A list of role names that should be automatically granted to an OAuth User. The roles will be created if they do not exist

Once you have an User domain class, initialize this plugin by using the init script grails init-oauth2 <domain-class-package> <user-class-name> <oauthid-class-name> In example: grails init-oauth2 com.yourapp User OAuthID That will create the domain class com.yourapp.oAuthID

Finally add:

static hasMany = [oAuthIDs: OAuthID]

to your user domain class.

Extensions

List of known extension

How to create a new provider plugin

  1. Create a new plugin with grails create-plugin spring-security-oauth2-myProvider
  2. Add the following plugins as dependency in build.gradle:
    • provided 'org.grails.plugins:spring-security-core:3.+'
    • provided 'org.grails.plugins:spring-security-oauth2:1.1.+'
  3. Create a service in your plugin that extends OAuth2AbstractProviderService and implement the abstract methods. You can override the other methods for fine-tuning if needed.

License

Apache 2

grails-spring-security-oauth2's People

Contributors

aitmanas avatar francoiskha avatar matrixcrawler avatar

Watchers

 avatar

Forkers

cbp-group

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.