Installation of Identity

Website = epghoa.org

On your DOC Pages @ Authenticate users with Netlify Identity | Netlify Docs it has the statement "To use the service in your site, you CAN add the Netlify Identity widget to your repository.

Like so many articles and tutorials it says WHAT TO DO but it does NOT say HOW OR WHERE TO DO IT.

I finally found the WHERE in another doc where it said it should be in your LANDING PAGE.

After reading most of your docs I still could NOT find anything on the HOW.

Can you point me to where I can find the HOW because the site I am building is to be available to only the residents of our subdivision and I want to use the password log-in for the residents access to the site.

Thank you

Gerald Brown

If you look at the @netlify/netlify-identity-widget repository it gives an example of how to use it

<!DOCTYPE html>
<html>
<head>
  <title>A static website</title>

  <!-- include the widget -->
  <script type="text/javascript" src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
</head>
<body>
  <!-- Add a menu:
   Log in / Sign up - when the user is not logged in
   Username / Log out - when the user is logged in
  -->
  <div data-netlify-identity-menu></div>

  <!-- Add a simpler button:
    Simple button that will open the modal.
  -->
  <div data-netlify-identity-button>Login with Netlify Identity</div>
</body>
</html>

What should the name of the HTML file be and where should it be located?

That would depend on what part or parts of the site you want to protect. Any path of a site that you want to protect requires the widget code in it.

I want to protect the WHOLE site, not just parts of it. Does this mean I need the widget on ALL pages?

Yes you will.

You might also want to look to Redirect visitors based on roles so that non-logged in users are shown the login page.

Does that mean the users will have to log in to every page?

I also thought that each user would create their own user name and password. Is this NOT true?

No. But Netlify Identity will make sure they are logged.

Yes, they can do that.

OK. Correct me if I am wrong. I put the widget on the HOME page, the user signs in & creates a user name & password, the next time they just log in by entering their password.

If they are logged in at the home page do I still need the widget on all pages?

I finally got it to work. Thanks for your help.

Glad you got it working! (:

I got the login working but after I log in NOTHING happens. How do I get it to continue to the site? Plus how do I log out again as the form has disappeared.

There’s nothing blocking from you continuing with the site. The repository shared by @jasiqli above has all the required information. You need to listen for the login event to do something after a user has logged in.

When I clicked on the above link by @jasiqli it says that person is no longer active.

How and where do I listen for the login event? The login window never appears.

One thing I have noticed about Netlify (and others) is it tells what to do but not how or where to do the required action.

In numerous pages in your documents it says “Install Netlify Identity widget” or “If the Netlify Identity widget is installed, do this or that”.

In my multiple readings of your docs I was unable to find any place where it said how to install it or where to install it.

BTW, I am able to send an Invite email but when I click on the link in the email I receive it takes me to my website but there is no widget to log-in or sign-up so I need to know where to put those 3 lines of code to generate the widget. I tried putting them in the “head.html” file but that did not work.

Sorry for the all caps but I am getting frustrated to get this to work as I want only residents of my subdivision to have access to the web site by being invited.

Can you point me to where it has the information I am looking for?

Thanks.

Hi, @gerbreown. I don’t know if you know this but writing in all capital letters is generally considered rude. Would you please edit your posts above to remove the use of all caps?

We won’t answer rudely asked questions so we’ll be waiting for that change to answer.

I have made the requested changes and added some farther information. Hopefully with the added information this problem can be solved.

Good news. I finally got the widget to show up when I clicked on the link in the email. However I am getting another error message which says: “Failed to handle signup webhook” when I enter a password in the Sign Up box. Is there some specific characters required or is there a minimum number of characters required for the password?

I created an “index.html” file in the layouts directory and added the 3 code lines before the “/head” line.

Another problem I just encountered is that the home page requires the password but all of the other pages are open. Will this be solved if I add the code to the “partial/head.html” file?

Is there still something else I need to do to get it working?

Thanks.

After reading all of the problems @aoloo wrote about I unselected all webhooks and now I can log in but I can no longer connect to my home page. I thought that Identity was supposed to be quick and easy to install.

Easy is defined differently by different people. Some could find something easy, others might not. It’s hard to put a label on subjective things. In any case, thank you for your feedback.

What does that mean? I can load your home page fine, so we would need more details to understand your meaning of cannot connect.