Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme cleanups #87

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading