Discussion:
UrlMappings - The page isn't redirecting properly
orion_mjcl
2011-12-21 03:49:59 UTC
Permalink
Hi everybody. I'm having a problem changing the default index page of my app.
I'm using the Spring Security plugin so I have a login view to enter the
credentials (username and password). I want this login view to be the
default view to be shown. I googled and I found that this change to the
UrlMappings class could solve my problem:

"/"(controller:'login', action:"/index")

When I ran my app once again and it seemed to work because the login view
was shown but after entering my credentials I got this message from my
Firefox browser:

Loading Image...

I'm sure I have to redirect "something" to "somewhere" but I don't know what
and where. I'm a Grails beginner and I'm completely lost about redirects and
url mappings.

Please help me.

Thanks in advance.

--
View this message in context: http://grails.1312388.n4.nabble.com/UrlMappings-The-page-isn-t-redirecting-properly-tp4220437p4220437.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Jeff Brown
2011-12-21 14:39:01 UTC
Permalink
Post by orion_mjcl
Hi everybody. I'm having a problem changing the default index page of my app.
I'm using the Spring Security plugin so I have a login view to enter the
credentials (username and password). I want this login view to be the
default view to be shown. I googled and I found that this change to the
"/"(controller:'login', action:"/index")
I don't know if this is the cause of your problem but you probably
don't want the leading slash in the action name.



jb
--
Jeff Brown
SpringSource
http://www.springsource.com/

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Spranger, Steffen
2011-12-21 14:54:37 UTC
Permalink
Hi folk,

Can I use spring-security to model some kind of role model, where access
roles are based on the target instance?

As an example, a REGION_OFFICER-role should model regions, like France,
UK, Asia, Europe, World.
A user with a REGION_OFFICER-role for France can edit instances
belonging to France, but cannot edit instances belonging to other
regions.

Nice to have: implicit roles, e.g. some with REGION_OFFICER-role for
Europe or World can also edit things of France, as it is a part of his
scope.


Instead of REGION_OFFICER one could think of access rights in a big
organisational tree structure.



Merry Xmas to all Grailers

Steffen

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Marcin Gryszko
2011-12-21 16:22:52 UTC
Permalink
You should take a look at Spring Security ACL plugin (
http://grails.org/plugin/spring-security-acl).

Your roles will be mapped to GrantedAuthoritySids and regions with their
correspondent ids to ObjectIdentity'ies

Marcin Gryszko <http://twitter.com/mgryszko>
<https://plus.google.com/112949188816397592850>
<http://xing.com/profile/Marcin_Gryszko> <http://linkedin.com/in/mgryszko>
<http://grysz.com/> <http://slideshare.net/mgryszko>


On Wed, Dec 21, 2011 at 3:54 PM, Spranger, Steffen <
***@incowia.com> wrote:
orion_mjcl
2011-12-23 21:58:45 UTC
Permalink
Thank you for answering but I'm still having the same problem. I want the
controller list (generated by Grails) to be shown after a successful login.

I removed the slash in the action name in this clause:
"/"(controller:'login', action:"/index")

Now it is:
"/"(controller:'login', action:"index")

as Jeff Brown-3 suggested but nothing has changed.

Any clue?

--
View this message in context: http://grails.1312388.n4.nabble.com/UrlMappings-The-page-isn-t-redirecting-properly-tp4220437p4229927.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Benjamin Klein
2011-12-24 02:12:54 UTC
Permalink
Is there a reason for the controller to use single quotes? The action and path use double quotes.

If the app uses Spring Security, the LoginController index will probably redirect to the auth action. That mapping shouldn't redirect the user *after* a login.

(Disclaimer: I am tired and need coffee, so do not take my remarks too seriously. :) )

--
b

Sent from my iPhone
Post by orion_mjcl
Thank you for answering but I'm still having the same problem. I want the
controller list (generated by Grails) to be shown after a successful login.
"/"(controller:'login', action:"/index")
"/"(controller:'login', action:"index")
as Jeff Brown-3 suggested but nothing has changed.
Any clue?
--
View this message in context: http://grails.1312388.n4.nabble.com/UrlMappings-The-page-isn-t-redirecting-properly-tp4220437p4229927.html
Sent from the Grails - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

ShatyUT
2011-12-21 14:53:45 UTC
Permalink
The spring security plugin will manage whether or not requests need to be
redirected to the login page. You should set your URL mapping to the home
page assuming successful authentication. Then in your config.groovy you can
set which files/folders in your application should require authentication
and which should not.

Check out the http://grails.org/screencast/show/11 linked screencast on
the http://grails.org/plugin/spring-security-core Spring Security Core
plugin page. That should show you what you need to know to set things up.
Also, the
http://grails-plugins.github.com/grails-spring-security-core/docs/manual/
plugin docs are extremely well written.

Shaty

--
View this message in context: http://grails.1312388.n4.nabble.com/UrlMappings-The-page-isn-t-redirecting-properly-tp4220437p4221958.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Loading...