grails-plugin

login automatically with Grails & Acegi

馋奶兔 提交于 2019-12-08 07:35:36
问题 I'm using the Acegi plugin in my Grails app. After a user registers, he is redirected to an action that is protected. Therefore, he is shown the login form. However, I would prefer if the user was automatically logged in as soon as he completes registration. It seems like I could achieve this by redirecting to the action that the login form uses redirect(uri:"/j_acegi_security_check?j_username=${username}&j_password=${passed}") But this would send a HTTP request to the client (and back to the

grails spring security login is not working

大城市里の小女人 提交于 2019-12-08 06:15:31
问题 I am using grails 2.1.0. I have installed spring-security-core plugin. When I create user it is creating it. But when I try to login then it shows: "Sorry, we were not able to find a user with that username and password." And there is also another fact that is when I use the same password for different user it does not save password with similar encoded value like for user 1 I have used password 123 which is saved in database like this

Grails Spring Security Plugin Migrate User Passwords from 1.2.7.3 to 2.0

主宰稳场 提交于 2019-12-07 20:19:19
问题 I am using Grails 2.3.2 and am trying to upgrade my Spring Security Core Plugin from 1.2.7.3 to 2.0. I made all the import changes and got my app to start, but I was unable to login. One of the changes in 2.0 is that it uses the bcrypt algorithm for passwords, making all my old passwords useless. So, I went through the password reset process in my app and sure enough after that I could log in just fine. But, I want to keep my old passwords for all my users, so I went and found the

Grails : getting assets local storage path inside the controller

夙愿已清 提交于 2019-12-07 17:24:47
问题 I need to extract the assets folder physical path in order to write a file from my controller. Any short way of achieving the file persistency from the controller? 回答1: Complete example: class ExampleService { def assetResourceLocator def someMethod() { Resource res = assetResourceLocator.findAssetForURI('test.css') String url = res.getURL() String uri = res.getURI() } } Source: https://stackoverflow.com/a/39642278/717267 回答2: Look at the AssetProcessorService inside the plugin. There are

Grails 1.3.5 and Spring Security Core

£可爱£侵袭症+ 提交于 2019-12-07 10:34:46
问题 I have build a grails application, which on login redirects users to different URLs based on User's role (custom roles defined in roles domain). Now I am trying to integrate Spring Security Core Grails Plugin to the application, so plan to use the plugin's domain model. I understand the auth action in LoginController does the user login validation and if the user is logged in the redirects to default target URI. My question is how can I know if the logging in user is of type ROLE_ADMIN or

Grails ehcache plugin - Another unnamed CacheManager already exists in the same VM

筅森魡賤 提交于 2019-12-07 04:54:42
问题 I run my Grails application using ehcache for my 2nd level Cache and it works. I installed the ehcache plugin + cache plugin and then it doesn't. I tried almost all solutions from the internet and found no solution I keep getting Another unnamed CacheManager already exists in the same VM . One of the possible solutions is to set p:shared=true in the EhCacheManagerFactoryBean , this works if I use an old plugin "springcache plugin from grails" but with the new plugin they use a modified

Grails3 controller integration test case fail: No thread-bound request found

不问归期 提交于 2019-12-07 04:49:43
问题 With just simple following controller action spock integration-test. Here is my Test. @Integration @Rollback class TestControllerSpec extends Specification { def setup() { } def cleanup() { } void "test something"() { setup: def c = new TestController() c.index() expect: c.response.contentType !=null } } getting following Exception java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request

ldap.rememberMe.usernameMapper.userDnBase (multiple instances of?) (searchSubtree search capability)

旧城冷巷雨未停 提交于 2019-12-07 02:35:37
I have a Grails application that is successfully using the latest spring-security-core:2.0-RC4 and spring-security-ldap:2.0-RC2 . Users can login perfectly using grails.plugin.springsecurity.ldap.search.base setting for LDAP login authentication. There is a different setting for the rememberMe userDnBase (mapper) and that setting is: grails.plugin.springsecurity.ldap.rememberMe.usernameMapper.userDnBase The LDAP authentication grails.plugin.springsecurity.ldap.search.base is set to ou=people,dc=sitcudy,dc=edu . As mentioned above - the logins work fine because there is a property called

belongsTo multiple Domain

醉酒当歌 提交于 2019-12-06 13:40:32
问题 I have 4 classes, incidents,problems, requests and another is Attachment. Every domain look like......... Class Incidents { // other fields static hasOne = [attachment: Attachment] static constraints = [attachment nullable:true] } Class Problems { // other fields static hasOne = [attachment: Attachment] static constraints = [attachment nullable:true] } Class Requests { // other fields static hasOne = [attachment: Attachment] static constraints = [attachment nullable:true] } Class Attachment {

How to use jasperreports subreports with grails jasper plugin?

元气小坏坏 提交于 2019-12-06 13:37:28
问题 I would like to use subreports with grails jasper plugins, I followed the manual at this url (http://www.grails.org/plugin/jasper). Here is my code : Domain Book : class Book { static belongsTo = Library Library library String title String author String publisher String category static constraints={ title() author() publisher() category() } } Domain Library : class Library { static hasMany = [ books : Book ] String name String adresse Date dateMaturity static constraints = { } String toString