|
This post has NOT been accepted by the mailing list yet.
I've overridden the Spring Security UI Plugin's RegistrationCode domain object since I had to add my own unique mappings. Where can I specify the name of my new class so that the application knows where to find it? For the Spring Security Core Plugin, I was able to add something like grails.plugins.springsecurity.authority.className = 'com.acme.fheg.Role' to Config.groovy. Is that where I should be adding the RegistrationCode classname? If so, what is the prefix I should be using? Thanks.
|
|
There isn't a property for the class name since customizing the domain class will most likely need controller and/or GSP changes, so you'll need to use the s2ui-override script for both 'register' and 'registrationcode'.
For RegistrationCodeController you'll need to copy the entire controller into the one the script creates (i.e. extend AbstractS2UiController not the plugin's RegistrationCodeController) since every action references the plugin's domain class. So run "grails s2ui-override registrationcode com.yourco.yourapp" and copy the plugin's controller contents into yours. It should be nearly identical except for the package and perhaps some imports. For RegisterController run "grails s2ui-override register com.yourco.yourapp" and copy the register, verifyRegistration, forgotPassword, and resetPassword actions from the base class since they reference the plugin's domain class. The s2ui-override script copies GSPs but if you've only changed mappings you'll want to delete these and use the plugin's GSPs. Burt > I've overridden the Spring Security UI Plugin's RegistrationCode domain > object since I had to add my own unique mappings. Where can I specify the > name of my new class so that the application knows where to find it? For the > Spring Security Core Plugin, I was able to add something like > grails.plugins.springsecurity.authority.className = 'com.acme.fheg.Role' to > Config.groovy. Is that where I should be adding the RegistrationCode > classname? If so, what is the prefix I should be using? Thanks. > > ______________________________________ > View message @ http://grails.1312388.n4.nabble.com/Spring-Security-UI-Plugin-Forgot-Password-Question-tp2539572p2539572.html > To start a new topic under Grails - user, email [hidden email] > To unsubscribe from Grails - user, click http://grails.1312388.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=1312389&code=YnVydEBidXJ0YmVja3dpdGguY29tfDEzMTIzODl8ODY4NjI5MDE2 > |
|
This post has NOT been accepted by the mailing list yet.
Thanks for the response Burt. I used the s2ui-override script to generate a RegistrationCodeController and RegisterController.
For RegistrationCodeController, I extended AbstractS2UiController and left all of the references to RegistrationCode as is. For RegisterController, I extended grails.plugins.springsecurity.ui.RegisterController and changed all references that were referring to RegistrationCode to my new domain class SecRegistrationCode (SecRegistrationCode simply extends org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode since I needed to modify the mappings). I deleted all of the GSP's as per your suggestion. When I run the app and click the "Forgot password" link, I get a 404 error (The requested resource (/patronLookup/WEB-INF/grails-app/views/register/forgotPassword.jsp) is not available). Am I doing something wrong? |
|
Sorry, looks like you'll need the GSPs since there's no convenient way to render a plugin's views from an app's controller. I was trying to avoid copying too much from the plugin since that'll impact upgrades, but a lot of the UI of this plugin should be considered starter code since your workflows are very likely to differ from what's provided out of the box.
Burt > > Thanks for the response Burt. I used the s2ui-override script to generate a > RegistrationCodeController and RegisterController. > > For RegistrationCodeController, I extended AbstractS2UiController and left > all of the references to RegistrationCode as is. > > For RegisterController, I extended > grails.plugins.springsecurity.ui.RegisterController and changed all > references that were referring to RegistrationCode to my new domain class > SecRegistrationCode (SecRegistrationCode simply extends > org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode since > I needed to modify the mappings). > > I deleted all of the GSP's as per your suggestion. > > When I run the app and click the "Forgot password" link, I get a 404 error > (The requested resource > (/patronLookup/WEB-INF/grails-app/views/register/forgotPassword.jsp) is not > available). > > Am I doing something wrong? > > ______________________________________ > View message @ http://grails.1312388.n4.nabble.com/Spring-Security-UI-Plugin-Forgot-Password-Question-tp2539572p2540807.html > To start a new topic under Grails - user, email [hidden email] > To unsubscribe from Grails - user, click http://grails.1312388.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=1312389&code=YnVydEBidXJ0YmVja3dpdGguY29tfDEzMTIzODl8ODY4NjI5MDE2 > |
|
One correction - you should delete register.gsp from the layouts folder since the plugin's layout can be used by the app's GSPs. If you do need to override register.gsp you'll need to fix several of the CSS and JS tags to add "plugin:'spring-security-ui'" (CSS tags) or plugin='spring-security-ui' (JS tags) as otherwise the page will look weird since the browser will attempt to get those files from the app's web-app folder and fail.
Burt > > Sorry, looks like you'll need the GSPs since there's no convenient way to render a plugin's views from an app's controller. I was trying to avoid copying too much from the plugin since that'll impact upgrades, but a lot of the UI of this plugin should be considered starter code since your workflows are very likely to differ from what's provided out of the box. > > Burt > > > > > Thanks for the response Burt. I used the s2ui-override script to generate a > > RegistrationCodeController and RegisterController. > > > > For RegistrationCodeController, I extended AbstractS2UiController and left > > all of the references to RegistrationCode as is. > > > > For RegisterController, I extended > > grails.plugins.springsecurity.ui.RegisterController and changed all > > references that were referring to RegistrationCode to my new domain class > > SecRegistrationCode (SecRegistrationCode simply extends > > org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode since > > I needed to modify the mappings). > > > > I deleted all of the GSP's as per your suggestion. > > > > When I run the app and click the "Forgot password" link, I get a 404 error > > (The requested resource > > (/patronLookup/WEB-INF/grails-app/views/register/forgotPassword.jsp) is not > > available). > > > > Am I doing something wrong? > > > > ______________________________________ > > View message @ http://grails.1312388.n4.nabble.com/Spring-Security-UI-Plugin-Forgot-Password-Question-tp2539572p2540807.html > > To start a new topic under Grails - user, email [hidden email] > > To unsubscribe from Grails - user, click http://grails.1312388.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=1312389&code=YnVydEBidXJ0YmVja3dpdGguY29tfDEzMTIzODl8ODY4NjI5MDE2 > > > > > |
|
This post has NOT been accepted by the mailing list yet.
Something still isn't quite right. When I click the "forgot password" link and enter a username, I get a Grails Runtime Exception: ORA-02289: sequence does not exist.
I created a domain class called SecRegistrationCode that extends org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode. The reason for me doing this was so I could add a static mapping block. I then used the s2ui-override script to generate a RegistrationCodeController and RegisterController. For RegistrationCodeController, I extended AbstractS2UiController and left all of the references to RegistrationCode as is. For RegisterController, I extended grails.plugins.springsecurity.ui.RegisterController and changed all references that were referring to RegistrationCode to my new domain class SecRegistrationCode. It almost seems like the app is still trying to access the plugin's domain class, RegistrationCode. Am I missing something obvious? |
|
Rather than extending the plugin's domain class (which probably involves Hibernate inheritance) I'd just copy it and make the required changes since it's just 3 properties. I might have missed a reference to the plugin's domain class - the worst-case scenario is just to copy the whole controller and change the domain class name throughout. Be sure to run 'grails clean' too.
Burt > > Something still isn't quite right. When I click the "forgot password" link > and enter a username, I get a Grails Runtime Exception: ORA-02289: sequence > does not exist. > > I created a domain class called SecRegistrationCode that extends > org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode. The > reason for me doing this was so I could add a static mapping block. I then > used the s2ui-override script to generate a RegistrationCodeController and > RegisterController. > > For RegistrationCodeController, I extended AbstractS2UiController and left > all of the references to RegistrationCode as is. > > For RegisterController, I extended > grails.plugins.springsecurity.ui.RegisterController and changed all > references that were referring to RegistrationCode to my new domain class > SecRegistrationCode. > > It almost seems like the app is still trying to access the plugin's domain > class, RegistrationCode. > > Am I missing something obvious? > > > ______________________________________ > View message @ http://grails.1312388.n4.nabble.com/Spring-Security-UI-Plugin-Forgot-Password-Question-tp2539572p2541069.html > To start a new topic under Grails - user, email [hidden email] > To unsubscribe from Grails - user, click http://grails.1312388.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=1312389&code=YnVydEBidXJ0YmVja3dpdGguY29tfDEzMTIzODl8ODY4NjI5MDE2 > |
|
This post has NOT been accepted by the mailing list yet.
Looks like I'm getting closer. When I click on the link to reset the password though, I get a Grails Runtime Exception:
"Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25; nested exception is: java.net.ConnectException" I created a mail closure in Config.groovy with the correct mail server host and post, so I'm not sure why the app is trying to access host localhost. Any ideas? |
|
Nevermind. That was an error on my part. I figured it out. Thanks.
|
|
This post has NOT been accepted by the mailing list yet.
why not create secUser, secRole and secRegistrationCode on initial plugin configuration?
hence we will have acces to the 3 domain classes |
| Powered by Nabble | Edit this page |
