Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

How to Protect specific page with only password?

admin plugins

Solved by Alexandre Martignier View solution

Started by frenchbeta 6 years ago · 6 replies · 2593 views
6 years ago

Hi everyone,

I know that this question was already asked a few years ago but not having found the answers sought I allow myself to ask this question again.
I am trying to protect a single page with a password. I know admin plugin can do that but only with a link account no? 🙄

I've find this plugin private_plugins But I am not strong enough on grav to get the plugins activated only on the page I want. 😔

Thanks for reading me

6 years ago

Hi, @AlexMart thank you for your answer,

I know it can be with the login plugin but I don't want to create a user account, just ask for a password to display a speficic page.
And it seems to me that the admin plugin asks for a username to display the desired page and not just a password no?

6 years ago

Hey,

So I've check the doc of the private_plugin and it's not very clear how private page works but I figured out. I've check the closed issues and a lot of people had the same issue.

So after installing the private plugin copy/past the private.yaml to your user/config/plugins folder and open it. Then change the line private_site:true to private_site:false.

Then you can go on individual page and add this to the header :

YAML
---
title: Home //exemple
taxonomy:
  tag: hidden
---

If it's not working try to logout first with the url yoursite.com/logout

Tell me if it woks for your.

👍 1
6 years ago

Oh thank you very much, I forgot the "taxonomy": that's why the plugins didn't work before ! 🙂

It's really nice of you for helping me.

Just one last question, how can I change the password?

6 years ago Solution

According to the doc you can change the password in the line

TXT
users:
    no_user : sha1_password

Note : The password MUST BE a SHA1 value. For quick checking see SHA1 Online to generate your SHA1 password. But it is adwised to generate it locally as http and any transmission is not as secure as no transmission at all. Use command: echo -n "yourpassword" | sha1sum . You can remove it thereafter from bash history with history -d 1234 and sourcing the ~/bashrc.

6 years ago

OK,
Thanks again for your help, have a nice day ! 😃

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 43 1 week ago
Plugins · by Xavier, 4 weeks ago
2 53 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1179 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 47 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 72 2 months ago