matrixcrawler / grails-spring-security-oauth2 Goto Github PK
View Code? Open in Web Editor NEWThis project forked from enr/s2oauth
Spring security Oauth Grails 3 plugin
License: Apache License 2.0
This project forked from enr/s2oauth
Spring security Oauth Grails 3 plugin
License: Apache License 2.0
I was getting a bizarre error only to realize I had not included all required configurations. I think there should be a meaningful check at startup to flag for missing configurations. In my case it was oauth2.domainClass
, which there is no documentation for at all - at least that I could find.
I have had a request from https://bintray.com/jokuni/plugins/spring-security-oauth2
To publish a 1.1.1 version of this plugin to the Grails central repo. Please can you confirm this is ok?
Hi! I don't know if you're in the Grails Slack community.
I wanted to reach out because I created an extension of your plugin to use Github. https://github.com/rpalcolea/grails-spring-security-oauth2-github
Hope that's ok with you, I followed the way you coded the Google's one.
Roberto
Many Github accts choose to hide their email address in settings (this is different than simply marking the email private, which can still be requested by the connecting app). When these users connect an app using this plugin, an exception will be thrown from GithubOAuth2Service.createSpringAuthToken
. Since the username is still available though, it a better approach might be to add username to the GithubOauth2SpringToken
. and proceed with token creation, since User creation can may be able to use that as the unique username instead.
When I want to use the GSP method "oauth2:ifLoggedInWith" with Facebook, the SpringSecurityOauth2BaseService oAuth2BaseService is not initialized, so the GSP crashes with the error:
2017-03-28 10:04:32.328 ERROR --- [nio-8080-exec-1] .a.c.c.C.[.[.[.[grailsDispatcherServlet] : Servlet.service() for servlet [grailsDispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.grails.gsp.GroovyPagesException: Error processing GroovyPageView: [views/home/index.gsp:64] Error executing tag <oauth2:ifLoggedInWith>: Cannot invoke method sessionKeyForAccessToken() on null object] with root cause
Seen a similar issue here:
This is | grails 3.1.10 | Gradle 2.10, following dependencies:
compile 'org.grails.plugins:spring-security-oauth2:1.1.0'
compile 'org.grails.plugins:spring-security-oauth2-google:1.1.0'
//Custom for datingsite plugins
compile 'org.springframework:spring-test:2.5'
compile 'org.springframework.social:spring-social-facebook:2.0.3.RELEASE'
compile 'org.springframework.security:spring-security-core:4.0.3.RELEASE'
compile 'org.springframework.security:spring-security-web:4.0.3.RELEASE'
compile 'org.grails.plugins:spring-security-core:3.0.3'
compile 'org.grails.plugins:spring-security-facebook:0.18'
Line 77 is
static void main(String[] args) {
GrailsApp.run(Application, args)
}
Also grails/plugin/springsecurity/ControllerMixin
thought things changed from grails/plugin
to grails/plugins
Unsure do I need to upgrade/downgrade ?
Actual error:
ERROR org.springframework.boot.SpringApplication - Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplicationPostProcessor' defined in xxxx.Application: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.boot.config.GrailsApplicationPostProcessor]: Factory method 'grailsApplicationPostProcessor' threw exception; nested exception is grails.plugins.exceptions.PluginException: Failed to initialize class [grails.plugin.springsecurity.oauth2.SpringSecurityOAuth2Controller] from plugin [springSecurityOauth2] : grails/plugin/springsecurity/ControllerMixin
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:120)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at grails.boot.GrailsApp.run(GrailsApp.groovy:55)
at grails.boot.GrailsApp.run(GrailsApp.groovy:365)
at grails.boot.GrailsApp.run(GrailsApp.groovy:354)
at grails.boot.GrailsApp$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
at xxxxx.Application.main(Application.groovy:77)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.boot.config.GrailsApplicationPostProcessor]: Factory method 'grailsApplicationPostProcessor' threw exception; nested exception is grails.plugins.exceptions.PluginException: Failed to initialize class [grails.plugin.springsecurity.oauth2.SpringSecurityOAuth2Controller] from plugin [springSecurityOauth2] : grails/plugin/springsecurity/ControllerMixin
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 23 common frames omitted
Caused by: grails.plugins.exceptions.PluginException: Failed to initialize class [grails.plugin.springsecurity.oauth2.SpringSecurityOAuth2Controller] from plugin [springSecurityOauth2] : grails/plugin/springsecurity/ControllerMixin
at org.grails.plugins.BinaryGrailsPlugin.initializeProvidedArtefacts(BinaryGrailsPlugin.java:154)
at org.grails.plugins.BinaryGrailsPlugin.<init>(BinaryGrailsPlugin.java:88)
at grails.plugins.DefaultGrailsPluginManager.createBinaryGrailsPlugin(DefaultGrailsPluginManager.java:391)
at grails.plugins.DefaultGrailsPluginManager.findCorePlugins(DefaultGrailsPluginManager.java:378)
at grails.plugins.DefaultGrailsPluginManager.attemptLoadPlugins(DefaultGrailsPluginManager.java:330)
at grails.plugins.DefaultGrailsPluginManager.loadPlugins(DefaultGrailsPluginManager.java:240)
at grails.boot.config.GrailsApplicationPostProcessor.initializeGrailsApplication(GrailsApplicationPostProcessor.groovy:87)
at grails.boot.config.GrailsApplicationPostProcessor.setApplicationContext(GrailsApplicationPostProcessor.groovy:211)
at grails.boot.config.GrailsApplicationPostProcessor.<init>(GrailsApplicationPostProcessor.groovy:76)
at grails.boot.config.GrailsAutoConfiguration.grailsApplicationPostProcessor(GrailsAutoConfiguration.groovy:62)
at myprofessions.Application.grailsApplicationPostProcessor(Application.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 24 common frames omitted
Caused by: java.lang.NoClassDefFoundError: grails/plugin/springsecurity/ControllerMixin
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:677)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:787)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:775)
at org.grails.plugins.BinaryGrailsPlugin.initializeProvidedArtefacts(BinaryGrailsPlugin.java:152)
... 40 common frames omitted
Caused by: java.lang.ClassNotFoundException: grails.plugin.springsecurity.ControllerMixin
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 56 common frames omitted
When I deploy my application in Heroku, the callback returns with the following URL: http: // localhost: 8080 / ....
Is this repo active and if so, how is it related to https://github.com/grails/grails-spring-security-oauth2?
If it is not active, should it be archived and point users to the above repo instead?
The username field is transient in my User class. I need only the user's email for the auth. So, I get an error because this field is not present in the database. How change this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.