Skip to content

Commit

Permalink
Merge pull request #87 from gsartori/4.0.x
Browse files Browse the repository at this point in the history
Readme cleanups
  • Loading branch information
jamesfredley authored Dec 23, 2024
2 parents 373677c + 4f4824b commit 859fb03
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Spring Security OAuth2 Plugin

Main differences with the Grails 2 plugin:

- no more dependency on https://github.com/antony/grails-oauth-scribe but some code of that plugin was ported in this
- No more dependency on https://github.com/antony/grails-oauth-scribe but some code of that plugin was ported in this
- Relies on [Scribejava](https://github.com/scribejava/scribejava) to do most of the OAuth logic
- simplest code as possible
- easy to extend
- Simplest code as possible
- Easy to extend

Documentation
------------
Expand All @@ -18,7 +18,7 @@ Installation
For Grails 5.3+

Add the following dependencies in `build.gradle`
```
```groovy
dependencies {
...
implementation 'org.grails.plugins:spring-security-core:5.2.1'
Expand All @@ -30,15 +30,17 @@ You will also need at least one provider extension, i.e the `grails-spring-secur
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
```
```yaml
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
plugin:
springsecurity:
oauth2:
active: true #whether the whole plugin is active or not
registration:
# The URI that is called to aks the user to either create a new account or link to an existing account
askToLinkOrCreateAccountUri: '/oauth2/ask'
# A list of role names that should be automatically granted to an OAuth User. The roles will be created if they do not exist
roleNames: [ 'ROLE_USER' ]
```
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>`
Expand All @@ -57,7 +59,8 @@ Extensions
List of known extension
* [Google](https://github.com/grails-plugins/grails-spring-security-oauth2-google)
* [Facebook](https://github.com/MatrixCrawler/grails-spring-security-oauth2-facebook)
* [Github] (https://github.com/rpalcolea/grails-spring-security-oauth2-github)
* [Github](https://github.com/rpalcolea/grails-spring-security-oauth2-github)
* [Okta](https://github.com/oktadev/okta-grails-example)


How to create a new provider plugin
Expand Down

0 comments on commit 859fb03

Please sign in to comment.