I am validating the users of my application with LDAP, and it works.
But now I need to assign my own roles and map them to my database.
I have been following a few tutorials, like this: https://chlebik.wordpress.com/2014/10/27/ldap-authentication-and-db-authorisation-with-grails-spring-security/
My problem is that my imports have errors because Grails doesn´t found the classes. For example:
import org.codehaus.groovy.grails.plugins.springsecurity.GrailsUserDetailsService
import org.springframework.security.core.authority.GrantedAuthorityImpl
import org.springframework.security.core.userdetails.UserDetails
I am using Grails 2.4.4
My plugins in config.groovy:
compile ":spring-security-core:2.0-RC4"
compile ":spring-security-ldap:2.0-RC2"
If you need any information, tell to me please.
Any help or tutorial would be good.
Those would be
import grails.plugin.springsecurity.userdetails.GrailsUserDetailsService
import org.springframework.security.core.authority.SimpleGrantedAuthority
import org.springframework.security.core.userdetails.UserDetails
The source is here and the docs include a section on changes made in the 2.0 plugin.
Related
I have created a grails+Gwt project with gwt plugin from grails.
I am able to run a hello world .
Next, I am trying to return some dto class from server to client.
But it always gets failed.
No source code is available for type domainclasses.UserEntity; did you forget to inherit a required module?
I have placed this entity/dto class in the domain package .
Also added in my Application.gwt.xml
<source path='domain.domainclasses'/>
I am unable to understand how to deal with/ where to place entity/dto classes in case of Grails/GWT Project
screenshot of my project structure:
http://screencast.com/t/JVRrTxto70
please guide.
thanks
Did anyone tried to implement JPivot in Grails? Can some one help me how I should import wcf and jp jars and dependencies and how to use their tag in my view?
From what I know the jpivot project has been replaced by pivot4j (www.pivot4j.org)
There has been discussion on the mailing list how to use pivot4j and grails, you can read it at https://groups.google.com/forum/#!msg/pivot4j-list/1st18J1G1_Q/UAuJeflMUpcJ
I want to logout manually and I use Grails Redirect Post-Logout Using spring-security-core-3.0.6+ to resolve my issues but there is an error of "Unable to resolve Authentication" so can anyone help me how to import Authentication and SecurityContextHolder in grails?
Here is how you imported:
import org.springframework.security.core.Authentication
import org.springframework.security.core.context.SecurityContextHolder
Plugins in Grails are great method to modularise an application.The documentation suggest to override the artifacts from the plugin in the application, which uses this plugin.
Is it realy the best approach?
Let's describe it by example: There is a domain class "org.User" defined in the plugin. The application overrides this domain class. If I use "grails run-app" then there are no warnings and it works. But Eclipse (GGTS) complains about "Invalid duplicate class definition of class org.User". For some developers it wouldn't matter, but I like the IDE helping on coding by stuf like "autocomplete".
At the end both classes are compiled an put on the java class loader. The application version of the class is loaded before the version of the plugin. The class resolver finds it first and that's why it works. Please correct me if I'm wrong at this point. Is it realy a good idea to have two versions of a class in one class loader?
What are the alternatives?
You can do like Spring Security Core plugin does, provide the User class as a template, so your application that use this plugin can choose between creating his own class or installing your default User class.
The plugin user template is here, and the script responsible to create this in the application is here.
You will need also a config value to know the class to use, and use it dynamic.
P.S: there are good security plugins like Shiro and Spring Security, maybe it's easier to check them instead of create your own.
I created a grails plugin in which some domain classes, controllers and views were added. After creating the plugin, I imported it in a grails application by using "grails.plugin.location.'...' = '.....'" in BuildConfig.groovy.
Everything is okay when the application starts up. And, everything is nice when online modifying the view GSPs in the plugin.
But, when I modified any controller in the plugin, the grails cannot find the view files corresponding to the modified controller in the plugin. Tomcat reported "HTTP Status 404" error. And, everything becomes okay again after restarting grails.
I am using Grails 1.3.3 and Groovy 1.7.2.
After googling, I found it was an unresolved bug. Please refer to the following URL:
http://jira.codehaus.org/browse/GRAILS-5869
In the bug page, there is a workaround reported. You can add annotation for the controller class of your plugin to make everything okay. Following is an example:
import org.codehaus.groovy.grails.plugins.metadata.GrailsPlugin
#GrailsPlugin(name='...', version='...')
class ... {
....
}