Manage and Authenticate Users with Netlify Identity
Tags: netlify, development, workflow
Published: 2022-01-03 04:18:04

---
title: Manage and Authenticate Users with Netlify Identity
published: true
description: By the power of GoTrue you can use Netlify Identity to help gate content, add site administration, login with external OAuth providers, and more!
tags: Netlify, Development, Workflow
cover_image: https://raw.githubusercontent.com/netlify/netlify-identity-widget/HEAD/identity.png
canonical_url: https://www.netlify.com/blog/2021/12/30/manage-and-authenticate-users-with-netlify-identity/
series: Netlify - a feature a day 2021
---
> Throughout December we'll be [highlighting a different Netlify feature each day](https://www.netlify.com/blog/2021/12/01/highlighting-a-different-netlify-feature-each-day-in-december/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=netlify-identity). It might just be the thing you need to unlock those creative juices, and [dust off that domain](https://www.netlify.com/blog/2021/12/01/dusty-domains-your-forgotten-domains-raise-money-for-charity/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=netlify-identity) you registered but never deployed! Keep an eye [on the blog](https://www.netlify.com/blog/2021/12/01/highlighting-a-different-netlify-feature-each-day-in-december/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=netlify-identity) and on [Twitter](https://twitter.com/netlify) for each feature!

"Authenticating users is a no-brainer", said no one ever. Managing user data, creating a login process, setting roles, gating content, these things are hard. One of my favorite strategies in web app development is getting a leg up by having someone else do the hard part. After all, you can't spell 'delegation' without 'leg'.

[Netlify Identity](https://docs.netlify.com/visitor-access/identity/) lets us delegate a ton of authentication functionality:

* the setup and infrastructure of storing user information, as well
* login using external OAuth providers like GitHub, Google, GitLab, and Bitbucket
* trigger serverless functions on validation, signup, or login events
* generate custom emails
* access and edit user information and roles
* and more!

![screenshot of identity dashboard page](https://cdn.netlify.com/f8ae462a132108b1eca556ad87308cbd69da3163/ced81/img/blog/identity.png "identity dashboard")

Leveraging the open-source [GoTrue API](https://github.com/netlify/gotrue), Netlify Identity can be added to your site with the [Netlify Identity widget](https://github.com/netlify/netlify-identity-widget) by adding this `<script>` tag:

```html
<head><script type="text/javascript" src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
</head>
```

then including the widget in the site template, like so:

```html
 <!-- 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>
```
Put it all together and you get this lovely pop-up modal window where users can login or sign up!

![netlify identity login modal window](https://cdn.netlify.com/9c580d1dd7c165720ac4746d305da1c445d102bf/9edd6/img/blog/screen-shot-2021-12-20-at-11.37.37-pm.png "modal window")

Check out the [Netlify Identity docs](https://docs.netlify.com/visitor-access/identity/) to learn more about everything you can do. I can't wait to see (or not see if I'm not logged in) all the authentication functionality you create! Happy coding 👩🏻‍💻!