hello everyone welcome to a new series for developers who are interested in developing with experience cloud and landing web runtime sites in our ninth episode we will look at authenticated and unauthenticated access for lwr sites depending on the type of site that you want to deploy you will either have a site that is available to anonymous users like the ac insurance marketing side or you will have a site that is only available to a user behind a login the lwr template is the first template that allows you to specify this during setup we're here in
the creation visit for a new lwr-based experience site what is different to any other provider template is that you can provide the authentication type during the setup process you choose an unauthenticated site if you want to provide public access to your site like any other website and if you want to provide an experience that should require login or authentication well you choose the authenticated option note that you can't change this afterwards for your site in the user interface now the authentication type reflects also as a visible distinction for your end users you may be used
to be able to identify experienced cloud sites by the slash s that is contained in the url for lwr sites there is a new distinction the slash s is still present for authenticated sites but for unauthenticated sites it's not that is to allow you to create truly consumer-facing urls like slash marketing get a quote instead of slash marketing as get a code and you can also check the authentication type in the experience bundle metadata of your site here is a side by side of the experience bundle configurations on the left for the marketing side the
authentication type is set to unauthenticated the base path for the marketing site is also just marketing and on the right for the agent portal the authentication type is set to authenticated which then means that the base path will contain the mandatory slash s and in case you want to allow guest users to access certain pages for an authenticated site you can set the authentication type to authenticate it with public access enabled and there are two ways to actually set this back in experience builder we can go to settings general and set the checkbox for public
can access the site unless we're working with a salesforce dx project and metadata we can also set it that way so let's swap to visual studio code and check out the network settings for a site that contains the well not so intuitive metadata name and hourglass chatter which is the counterpart of public can access the site and what i also want to highlight here is the metadata setting enable guest file access which you have to set to allow guest users to access file assets and that also includes assets from salesforce cms which we used in
a previous video what we haven't talked about yet is what unauthenticated users can do on your site those users are also called guest users and experience cloud sites provide a specialized profile for it the guest user profile this is not specific to lwr sites and also applies to experience class sites in general to access a profile you actually have to open it from experience builder once we click on it we are directed back to the profile editor page just for the guest profile and this is where you can then specify if guest users will have
special permissions like accessing data in your environment working with profiles and guest user permissions is an exhaustive topic check out the description where we'll link to learn experiencecloud.com as well as to the product documentation which both give you insights on how to work with this profile there's one more thing you may want to work in a programmatic way with a guest user profile and that's possible as everything is stored as metadata when you look at the metadata of our sample app you will notice that it contains profile and network metadata the name of the profile
is built by the name of the site plus the word profile with this mapping in mind it is possible to retrieve and deploy the guest user profile from a salesforce environment to allow repeatable and testable deployments for your sites and that's it what you have to know about authenticated and unauthenticated site options for lwr sites thanks so much for viewing and see you next and for the last time when we talk about the experience bundle and its deployment for lwr sites never miss an episode by subscribing and turning on your notifications [Music] you