Developer forum

Forum » Dynamicweb 10 » Permissions and Swift for protecting a website

Permissions and Swift for protecting a website

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have the task of setting up a website that will be completely restricted to anonymous users.
In DW9 we used to have a Login functionality where you would be able to set up the protection and trigger a Login dialog for any anonymous user.
Also, in the Master page of Swift v1 we used to have some logic for redirecting users to SignInPage if the page is protected. 
In my case, I am using DW10 + Swift v2 and I cannot figure out a way to handle this protection with standard configuration.

Can anybody point me in the right direction?

Thank you,

Adrian


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Adrian

In the latest DW10 - 10.17, if a page have permissions and the current visitor is either not logged in or does not have access to the page, they are automatically redirected to the first page in the website using the new login module - aka UserAuthentication app.

So if you add a page with the login module, and setup permissions, you should be ready to go.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai, 

Thank you.  A few questions then:
1. Is 10.17 already available?

2. What happens if I need to have a few public pages and the rest of the site protected? Is there any way to create a redirect to Login if a page is protected? Or set up a generic Login without messing up the Swift V2 master template?

Thank you,
Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Please disregard my 2nd point. I re-read the response, and you have already answered it.

Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Sorry - it is out in 10.16.

You can see all releases here: https://doc.dynamicweb.dev/documentation/fundamentals/dw10release/releasenotes/changelog.html and on Nuget: https://www.nuget.org/packages/Dynamicweb#versions-body-tab

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you,

I am running on DW 10.16.5, and I could not see the new Apps. I suppose I need to search for them and install?

Thank you,
Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

The new user modules are behind feature flag:

The Authenticate app is described here:
https://doc.dynamicweb.dev/documentation/implementing/content/apps/users/index.html

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

If I try to use the Authentication module combined with a Permission set at Website level, it ends up in a series of redirects and crashes.

I have also mentioned in another post (https://doc.dynamicweb.com/forum/swift/swift-2-existing-solution?PID=1605) another issue related to setting up permissions at website level

Thank you,
Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Adrian

We will look into it. But did you give permissions to see the login page? If you have set the permissions at website level - that would include the page with the login. So you need to allow anonymous access to that page.

I will take a look at the code and ensure that DW will not go into infinite loop and maybe provide an error message instead.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

That's not the point.
If I protect the website, in Visual Editor the ProductRelated pages are not displaying any content.
The login issue is a different matter and maybe it can resolved by granting explicit permissions to it for anonymous users. That would probably take care of the redirects. But the Context issue will still remain.

Adrian

 

You must be logged in to post in the forum