diff --git a/README.md b/README.md index af191de..5f5d85d 100644 --- a/README.md +++ b/README.md @@ -9,18 +9,20 @@ Main differences with the Grails 2 plugin: - simplest code as possible - easy to extend -Installation +Documentation ------------ -Use [v1.2.x](https://github.com/grails-plugins/grails-spring-security-oauth2-google/releases/tag/v1.2.0) for Grails 3.0 to 3.2 +[User Guide](https://grails.github.io/grails-spring-security-oauth2/) -Use v1.3.x for Grails 3.3+. +Installation +------------ +For Grails 5.3+ Add the following dependencies in `build.gradle` ``` dependencies { ... - compile 'org.grails.plugins:spring-security:3.2.+' - compile 'org.grails.plugins:spring-security-oauth2:1.2.0' + implementation 'org.grails.plugins:spring-security-core:5.2.1' + implementation 'org.grails.plugins:spring-security-oauth2:3.0.0' ... } ``` diff --git a/build.gradle b/build.gradle index b52e216..b990eaf 100644 --- a/build.gradle +++ b/build.gradle @@ -4,24 +4,30 @@ buildscript { } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" - classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.2.4" classpath "org.asciidoctor:asciidoctor-gradle-jvm:3.3.2" } } +plugins { + id 'maven-publish' + id 'idea' + id 'eclipse' + id 'signing' + id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' +} + + version project.projectVersion group = 'org.grails.plugins' -apply plugin:"eclipse" -apply plugin: "idea" + apply plugin: "java-library" apply plugin: "org.grails.grails-plugin" apply plugin: "org.grails.grails-gsp" -apply plugin: "org.grails.internal.grails-plugin-publish" -apply plugin: "asset-pipeline" apply plugin: "org.asciidoctor.jvm.convert" repositories { + mavenCentral() maven { url "https://repo.grails.org/grails/core" } } @@ -39,8 +45,6 @@ dependencies { console "org.grails:grails-console" profile "org.grails.profiles:web-plugin" - runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails:3.4.7" - testImplementation "org.springframework.boot:spring-boot-autoconfigure" testImplementation "org.springframework.boot:spring-boot-starter-actuator" testImplementation "org.springframework.boot:spring-boot-starter-tomcat" @@ -51,28 +55,88 @@ dependencies { documentation "com.github.javaparser:javaparser-core:3.15.14" } -grailsPublish { - githubSlug = 'grails/grails-spring-security-oauth2' - license { - name = 'Apache-2.0' +publishing { + publications { + maven(MavenPublication) { + + groupId = project.group + artifactId = 'spring-security-oauth2' + version = project.version + + from components.java + + artifact sourcesJar + artifact javadocJar + + pom { + name = 'Spring Security Oauth2 Plugin' + description = 'This plugin provides the capability to authenticate via oauth and depends on grails-spring-security-core.' + url = 'https://github.com/grails/grails-spring-security-oauth2' + licenses { + license { + name = 'The Apache License, Version 2.0' + url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + developers { + developer { + id = 'MatrixCrawler' + name = 'Johannes Brunswicker' + email = '' + } + developer { + id = 'aitmanas' + name = 'aitmanas' + email = '' + } + developer { + id = 'rvanderwerf' + name = 'Ryan Vanderwerf' + email = '' + } + developer { + id = 'puneetbehl' + name = 'Puneet Behl' + email = '' + } + } + scm { + connection = 'scm:git:https://github.com/grails/grails-spring-security-oauth2.git' + developerConnection = 'scm:git:https://github.com/grails/grails-spring-security-oauth2.git' + url = 'https://github.com/grails/grails-spring-security-oauth2/tree/2.0.x' + } + } + } + + } - title = "Spring Security OAuth2" - desc = """ - This plugin provides the capability to authenticate via oauth and depends on grails-spring-security-core. -""" - developers = [ - MatrixCrawler: "Johannes Brunswicker", - aitmanas: "aitmanas", - rvanderwerf: "Ryan Vanderwerf", - puneetbehl: "Puneet Behl" - ] - userOrg = 'grails' } -assets { - packagePlugin = true +//afterEvaluate { +// signing { +// //required { gradle.taskGraph.hasTask("publish") || gradle.taskGraph.hasTask("publishMavenPublicationToMavenLocal") } +// sign publishing.publications.maven +// } +//} + +nexusPublishing { + repositories { + sonatype { + def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : '' + def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : '' + def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : '' + nexusUrl = uri("https://s01.oss.sonatype.org/service/local/") + snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") + username = ossUser + password = ossPass + stagingProfileId = ossStagingProfileId + } + } } + + + tasks.withType(Test) { useJUnitPlatform() } diff --git a/gradle.properties b/gradle.properties index 4f00ab3..6e64a23 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,8 @@ -projectVersion=2.0.0-SNAPSHOT -grailsVersion=5.1.3 +projectVersion=3.0.0 +grailsVersion=5.3.2 grailsGradlePluginVersion=5.3.0 +groovyVersion=3.0.11 +gorm.version=7.3.3 vcsUrl=https://github.com/grails/grails-spring-security-oauth2 org.gradle.caching=true org.gradle.parallel=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 53b9e38..ffed3a2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c787..4f906e0 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/bin/sh +#!/usr/bin/env sh # -# Copyright © 2015-2021 the original authors. +# Copyright 2015 the original author or authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,101 +17,67 @@ # ############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# +## +## Gradle start up script for UN*X +## ############################################################################## # Attempt to set APP_HOME - # Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi done - -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null APP_NAME="Gradle" -APP_BASE_NAME=${0##*/} +APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +MAX_FD="maximum" warn () { echo "$*" -} >&2 +} die () { echo echo "$*" echo exit 1 -} >&2 +} # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -121,9 +87,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java + JAVACMD="$JAVA_HOME/jre/sh/java" else - JAVACMD=$JAVA_HOME/bin/java + JAVACMD="$JAVA_HOME/bin/java" fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -132,7 +98,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD=java + JAVACMD="java" which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -140,95 +106,80 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi fi -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi # For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg + i=`expr $i + 1` done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat old mode 100644 new mode 100755 diff --git a/grails-app/controllers/grails/plugin/springsecurity/oauth2/SpringSecurityOAuth2Controller.groovy b/grails-app/controllers/grails/plugin/springsecurity/oauth2/SpringSecurityOAuth2Controller.groovy index 20caabd..f525f8c 100644 --- a/grails-app/controllers/grails/plugin/springsecurity/oauth2/SpringSecurityOAuth2Controller.groovy +++ b/grails-app/controllers/grails/plugin/springsecurity/oauth2/SpringSecurityOAuth2Controller.groovy @@ -15,7 +15,6 @@ package grails.plugin.springsecurity.oauth2 import com.github.scribejava.core.model.OAuth2AccessToken -import com.sun.istack.internal.Nullable import grails.plugin.springsecurity.SpringSecurityService import grails.plugin.springsecurity.SpringSecurityUtils import grails.plugin.springsecurity.annotation.Secured @@ -35,8 +34,8 @@ import org.springframework.web.servlet.ModelAndView * * Based on SpringSecurityOAuthController:2.1.0.RC4 */ -@Slf4j @Secured('permitAll') +@Slf4j class SpringSecurityOAuth2Controller { public static final String SPRING_SECURITY_OAUTH_TOKEN = 'springSecurityOAuthToken' @@ -247,7 +246,7 @@ class SpringSecurityOAuth2Controller { * @param oAuthToken * @param redirectUrl */ - protected void authenticateAndRedirect(@Nullable OAuth2SpringToken oAuthToken, redirectUrl) { + protected void authenticateAndRedirect(OAuth2SpringToken oAuthToken, redirectUrl) { session.removeAttribute SPRING_SECURITY_OAUTH_TOKEN SecurityContextHolder.context.authentication = oAuthToken redirect(redirectUrl instanceof Map ? redirectUrl : [uri: redirectUrl]) diff --git a/grails-app/controllers/grails/plugin/springsecurity/oauth2/SpringSecurityOauth2UrlMappings.groovy b/grails-app/controllers/grails/plugin/springsecurity/oauth2/SpringSecurityOauth2UrlMappings.groovy index 55bf66f..7c8d7a2 100644 --- a/grails-app/controllers/grails/plugin/springsecurity/oauth2/SpringSecurityOauth2UrlMappings.groovy +++ b/grails-app/controllers/grails/plugin/springsecurity/oauth2/SpringSecurityOauth2UrlMappings.groovy @@ -7,7 +7,7 @@ import grails.util.Holders class SpringSecurityOauth2UrlMappings { static mappings = { - def active = Holders.grailsApplication.config.grails?.plugin?.springsecurity?.oauth2?.active + def active = Holders.grailsApplication.config.getProperty('grails.plugin.springsecurity.oauth2.active', Boolean, true) def enabled = (active instanceof Boolean) ? active : true if (enabled && SpringSecurityUtils.securityConfig?.active) { "/oauth2/$provider/authenticate"(controller: 'springSecurityOAuth2', action: 'authenticate') diff --git a/grails-app/services/grails/plugin/springsecurity/oauth2/SpringSecurityOauth2BaseService.groovy b/grails-app/services/grails/plugin/springsecurity/oauth2/SpringSecurityOauth2BaseService.groovy index 07909b3..50c70fe 100644 --- a/grails-app/services/grails/plugin/springsecurity/oauth2/SpringSecurityOauth2BaseService.groovy +++ b/grails-app/services/grails/plugin/springsecurity/oauth2/SpringSecurityOauth2BaseService.groovy @@ -157,7 +157,7 @@ class SpringSecurityOauth2BaseService { successUrl: successUrl, failureUrl: failureUrl, scope: scopes ? providerService.getScopes() + providerService.scopeSeparator + scopes : providerService.getScopes(), - debug: grailsApplication.config.getProperty('oauth2.debug') ? grailsApplication.config.getProperty('oauth2.debug') : false + debug: grailsApplication.config.getProperty('grails.plugin.springsecurity.oauth2.debug', Boolean, false) )) providerService.init(_providerConfigurationMap.get(providerService.providerID)) providerServiceMap.put(providerService.providerID, providerService) @@ -165,7 +165,7 @@ class SpringSecurityOauth2BaseService { } private def getConfigValue(String provider, String key) { - grailsApplication.config.getAt("grails.plugin.springsecurity.oauth2.providers.${provider}.${key}") ?: null + grailsApplication.config.getProperty("grails.plugin.springsecurity.oauth2.providers.${provider}.${key}") ?: null } /** * @return The base url @@ -196,7 +196,7 @@ class SpringSecurityOauth2BaseService { * @return The uri pointing to the page ask to link or create account */ def getAskToLinkOrCreateAccountUri() { - def askToLinkOrCreateAccountUri = grailsApplication.config.grails.plugin.springsecurity.oauth2.registration.askToLinkOrCreateAccountUri ?: '/oauth2/ask' + def askToLinkOrCreateAccountUri = grailsApplication.config.getProperty('grails.plugin.springsecurity.oauth2.registration.askToLinkOrCreateAccountUri', String, '/oauth2/ask') return askToLinkOrCreateAccountUri } @@ -237,7 +237,7 @@ class SpringSecurityOauth2BaseService { * @return The OAuthID class name */ protected String lookupOAuthIdClassName() { - def domainClass = grailsApplication.config.grails.plugin.springsecurity.oauth2.domainClass ?: 'OAuthID' + def domainClass = grailsApplication.config.getProperty('grails.plugin.springsecurity.oauth2.domainClass', 'OAuthID') return domainClass } @@ -294,7 +294,7 @@ class SpringSecurityOauth2BaseService { * @return The role names for a newly registered user */ def getRoleNames() { - def roleNames = grailsApplication.config.grails.plugin.springsecurity.oauth2.registration.roleNames ?: ['ROLE_USER'] + def roleNames = grailsApplication.config.getProperty('grails.plugin.springsecurity.oauth2.registration.roleNames', List, ['ROLE_USER']) return roleNames } } diff --git a/src/docs/extensions.adoc b/src/docs/extensions.adoc index ee9d168..bae00fb 100644 --- a/src/docs/extensions.adoc +++ b/src/docs/extensions.adoc @@ -21,4 +21,5 @@ dependencies { } ---- [start=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. \ No newline at end of file +. Create a service in your plugin that extends `OAuth2AbstractProviderService` and implement the abstract metho ds. You can override the +other methods for fine-tuning if needed. \ No newline at end of file diff --git a/src/docs/history.adoc b/src/docs/history.adoc index 567528f..24e69a9 100644 --- a/src/docs/history.adoc +++ b/src/docs/history.adoc @@ -2,5 +2,10 @@ Please read release notes at https://github.com/grails/grails-spring-security-oauth2/releases for checking release information in the future. +* Version 3.0.0 +** Upgraded to Grails 5.3 with Groovy 3..0.11 +** Fixed conflict with logback-config library. +* Version 2.0.0-RC1 +** Upgraded to Grails 5.1 * Version 1.0.0 ** released \ No newline at end of file diff --git a/src/main/groovy/grails/plugin/springsecurity/oauth2/SpringSecurityOauth2GrailsPlugin.groovy b/src/main/groovy/grails/plugin/springsecurity/oauth2/SpringSecurityOauth2GrailsPlugin.groovy index 2287f4d..4231618 100644 --- a/src/main/groovy/grails/plugin/springsecurity/oauth2/SpringSecurityOauth2GrailsPlugin.groovy +++ b/src/main/groovy/grails/plugin/springsecurity/oauth2/SpringSecurityOauth2GrailsPlugin.groovy @@ -61,10 +61,6 @@ This plugin provides the capability to authenticate via oauth. Depends on grails return } - if (!hasProperty('log')) { - this.metaClass.log = LoggerFactory.getLogger(SpringSecurityOauth2GrailsPlugin) - } - if (printStatusMessages) { println("Configuring Spring Security OAuth2 plugin...") }