If your initial worry is them viewing parts of the Umbraco Backoffice you don't want them to see yet, you can get extremely granular with Umbraco permissions, i.e. you could create them an account and assign a user group that just gives them read only access to 1 single Umbraco node (i.e. the page they want to preview).
Is there any particular reason they can't have a login?
The fastest & easiest solution to your problem is to publish the page.
If your domain name is domain.com and your page name is skljfsdjk43523424 you can then access it at domain.com/skljfsdjk43523424.
Nobody is going to guess this URL. Nobody, including robots, will find this page unless you put it into your sitemap.
It would also be a good opportunity to add properties to your document type for explicitly hiding a page from your sitemap, and telling bots not to index the page (if you haven't done this already).
If you find another solution, please share it as many people have this exact requirement. I just publish the page with an obfuscated URL.
I may have a solution, it seems to be working, but haven't done much testing yet and there are lots of rough edges.
The site is "headless" using Nuxt for the front end, all the controllers are hijacked to return json for nuxt instead of native rendering.
When a user clicks on save and preview in the Umbraco editor, I generate a token and then redirect to the nuxt site with the token instead of serving the json.
The nuxt site calls back to umbraco with the token and the UMB_PREVIEW cookie. If the token is valid, a middleware component looks up a user and sets it as the principal** for the request. (The user is defined in Umbraco with limited rights). Having the cookie and an Umbraco user as the principal makes UmbracoContext.InPreviewMode true. The UI sends an extra parameter to avoid a redirect loop
To add middleware in Umbraco, I used IStartupFilter
var user = await backOfficeUserManager.FindByNameAsync(config.Username);
var prin = await ucpf.CreateAsync(user);
httpContext.SetPrincipalForRequest(prin);
Is it possible to provide a preview url to a person who does not have a login
Hi,
I'm using Umbraco 10 and I would like to send a preview url to someone who doesn't have a User or Member to login with.
I've seen other CMS offer this option with a token in the url.
Is this possible with Umbraco?
Thanks
If your initial worry is them viewing parts of the Umbraco Backoffice you don't want them to see yet, you can get extremely granular with Umbraco permissions, i.e. you could create them an account and assign a user group that just gives them read only access to 1 single Umbraco node (i.e. the page they want to preview).
Is there any particular reason they can't have a login?
Its something that came up in during a discussion:
Its a feature some clients use sometimes for people who just want to see something on very rare occasions and don't want any extra steps.
The workflow package Plumber has this feature. Check the Offline approval section on the docs
The package (and its author) has just been acquired by Umbraco, and it's not free.
The fastest & easiest solution to your problem is to publish the page.
If your domain name is
domain.com
and your page name isskljfsdjk43523424
you can then access it atdomain.com/skljfsdjk43523424
.Nobody is going to guess this URL. Nobody, including robots, will find this page unless you put it into your sitemap.
It would also be a good opportunity to add properties to your document type for explicitly hiding a page from your sitemap, and telling bots not to index the page (if you haven't done this already).
If you find another solution, please share it as many people have this exact requirement. I just publish the page with an obfuscated URL.
I may have a solution, it seems to be working, but haven't done much testing yet and there are lots of rough edges.
The site is "headless" using Nuxt for the front end, all the controllers are hijacked to return json for nuxt instead of native rendering.
When a user clicks on save and preview in the Umbraco editor, I generate a token and then redirect to the nuxt site with the token instead of serving the json.
The nuxt site calls back to umbraco with the token and the UMB_PREVIEW cookie. If the token is valid, a middleware component looks up a user and sets it as the principal** for the request. (The user is defined in Umbraco with limited rights). Having the cookie and an Umbraco user as the principal makes UmbracoContext.InPreviewMode true. The UI sends an extra parameter to avoid a redirect loop
To add middleware in Umbraco, I used IStartupFilter
Just before services.AddUmbraco()
And the filter is fairly simple
To get the user I use 3 types that are injected into the middleware's Invoke method
IBackOfficeUserManager backOfficeUserManager , IUserClaimsPrincipalFactory
is working on a reply...