Grails login.gsp not present

Viewed 179

I'm running grails 3 with the security plugin (entry from gradle file)

compile group: 'org.grails.plugins', name: 'spring-security-core', version: '3.2.3'

Then run:

s2-quickstart mydomain User Role 

and now the security is being applied to the site.

Now I need to change the login.gsp page but it's not under views.

Must I run another command to generate it (and the controller)?

Thanks

3 Answers

First, We need to add Spring Security Core Plugin as a dependency: /build.gradle

compile 'org.grails.plugins:spring-security-core:3.2.0.M1'

Then,

There are two ways to override auth.gsp. By creating manually Controller and gsp or by using spring-security-ui plugin.

I have used second way to generate custom login page:

First, We need to add Spring Security Core Plugin as a dependency: /build.gradle

compile 'org.grails.plugins:spring-security-core:3.2.0.M1'

Use s2-quickstart to generate the default Spring Security Core domain classes:

grails s2-quickstart demo User Role

s2-quickstart script generates three domain classes; User, Role and UserRole.

Then install Grails spring-security-ui plugin from here

use grails s2ui-override auth command to override the login/auth.gsp form (this will create the login form so that you override it). Note: This command will not create controller. It create view at path login/auth.gsp

enter image description here

Use grails s2ui-override layout to override the layouts for the form(this will create the springSecurityUI.gsp layout so that you override it)

enter image description here

References: enter link description here

Note: Please check plugin documentation as per your grails version.

Hope this will helps you.

Related