Redirect to login instead of Access Denied message

rated by 0 users
This post has 2 Replies | 2 Followers

Not Ranked
Posts 15
Points 225
P4 Healthcare Posted: Mon, May 12 2008 2:57 PM

Several pages in CS 2008 that require that the user is logged in present an Access Denied message instead of redirecting the user to the login page with a ReturnUrl.  One example is to click "Message Board Subscriptions" from the forums right nav while not logged in.

How can I force a redirection to the login page rather than an Access Denied message?

Access Denied

You do not have permissions to perform the requested action.

Not Ranked
Posts 15
Points 225

I changed this throughout my site by replacing every instance of this:

<Actions><CSControl:GoToMessageAction runat="server" MessageType="AccessDenied" /></Actions>


With this:

<Actions>
    <CSControl:GoToSiteUrlAction runat="server" UrlName="login">
            <Parameter1Template><CSControl:ModifiedUrl runat="server" RenderRawUrl="true" Encoding="URL" /></Parameter1Template>
    </CSControl:GoToSiteUrlAction>
</Actions>

Does this seem ok?  Are there any instances where I would not want my user to be redirected back to the denied resource after logging in?

Thanks,
Graham

 

  • | Post Points: 20
Top 10 Contributor
Posts 3,424
Points 65,735
CS Developers
Ben Tiedt replied on Wed, May 21 2008 1:23 AM

 

P4 Healthcare:

Does this seem ok?  Are there any instances where I would not want my user to be redirected back to the denied resource after logging in?

 

Yes,that seems okay.  As long as these resources are not user-specific (have user information in the URL), this implementation should be fine.

Ben Tiedt's Blog

  • | Post Points: 5
Page 1 of 1 (3 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com