Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHow can we secure links in a module?How can we secure links in a module?
Previous
 
Next
New Post
3/12/2013 6:45 AM
 

I have been trying to create secure links in my module that request login before being used. But i haven't been able to reproduce the same behavior as the login link in the skin. Seems there's something wrong or missing from the link. Since it always redirects me to the main page instead of returning to the same page i was on. can anyone help me with this? what is wrong with my code?

int tid = p.PortalSettings.LoginTabId;                                myhyp.HRef = "http://" + portalAlias + "/tabid/" + tid.ToString() + "/language/" + System.Threading.Thread.CurrentThread.CurrentCulture.ToString() + "/Default.aspx?returnurl=" + HttpUtility.UrlEncode(Request.RawUrl);
myhyp.Target = "_self"; 
 

thanks

 
New Post
3/12/2013 7:20 AM
 
I think this is the wrong approach. Do not secure the link, secure the url it points to.

So if your link is to an open page the user gets there directly,

If your link is to a secure page AND they are already logged in with an account that is allowed on the page, they get there directly.

If your link is to a secure page AND they are NOT logged in with an account that is allowed on the page, they are challenged before they can get to the page.

Added benefit - you don't have to do any work it's all there already.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
3/12/2013 7:46 AM
 
The actual secured page is an aspx page in my project that's not a dnn page. That's why i need the mentioned code. I have tried the dnn popup but it's not functioning correctly, it's redirecting after login to the main page in the popup window instead of closing the popup. Which is unacceptable. i'm currently using dnn 6.2.6.
 
New Post
3/12/2013 7:59 AM
 
Ok I can see that's different.

I still think you need a way to secure that target page. Else anyone who knows/guesses/bookmarks the url will be able to see it. Nothing forces them to come via your links

How about this workaround? Add a new page to your site:
- secure it
- keep it out of the menu
- configure it to always redirect to the target aspx page.

Use that new page as the target for your link. I still think the ultimate target needs proper security.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
3/12/2013 8:05 AM
 
Thank you for the reply, that's quite a good idea, i'll try it now but i'm afraid it might not work since i'm sending querystring parameters to my page. In addition, i have secured my page using referral url which is common sense if i want it secured and inaccessible on its own.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHow can we secure links in a module?How can we secure links in a module?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out