# simple-strapi-auth

> This is the description of the plugin.

Latest version **1.0.19** (published 2025-05-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-strapi-auth
pnpm add simple-strapi-auth
yarn add simple-strapi-auth
bun add simple-strapi-auth
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.19 |
| Published | 2025-05-27 |
| First published | 2023-11-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=14.19.1 <=18.x.x |
| Dependencies | 7 |
| Unpacked size | 33.2 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | A Strapi developer |
| Maintainers | pdalvi1893, siddhesh_shetye |

## Links

- npm: https://www.npmjs.com/package/simple-strapi-auth
- npm.io page: https://npm.io/package/simple-strapi-auth

## Dependencies (7)

- [csrf](https://npm.io/package/csrf.md) ^3.1.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [@strapi/icons](https://npm.io/package/@strapi/icons.md) ^1.6.3
- [oauth2-server](https://npm.io/package/oauth2-server.md) ^3.0.1
- [express-oauth-server](https://npm.io/package/express-oauth-server.md) ^2.0.0
- [@strapi/design-system](https://npm.io/package/@strapi/design-system.md) ^1.6.3
- [@strapi/helper-plugin](https://npm.io/package/@strapi/helper-plugin.md) ^4.6.0

## Recent versions

- 1.0.19 (latest) — 2025-05-27
- 1.0.18 — 2024-12-04
- 1.0.17 — 2024-07-16
- 1.0.16 — 2024-06-14
- 1.0.15 — 2024-05-06
- 1.0.14 — 2024-03-18
- 1.0.13 — 2024-03-07
- 1.0.12 — 2024-03-07
- 1.0.11 — 2024-03-07
- 1.0.10 — 2024-02-01
- 1.0.9 — 2024-01-31
- 1.0.8 — 2024-01-23
- 1.0.7 — 2024-01-16
- 1.0.6 — 2024-01-10
- 1.0.5 — 2023-12-21
- … 5 more at https://npm.io/package/simple-strapi-auth/versions

## README

# Strapi plugin simple-strapi-auth

![](https://github.com/pdalvi1893/simple-auth)

Working on Strapi version: v4.*.*

## First Setup

1. Install as an npm dependency

```bash
# install dependencies
npm install simple-strapi-auth

```

2. Check the below api's to generate token and refresh token

```bash
# Access token generation CURL

curl --location 'http://localhost:1337/simple-auth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic bXlDbGllbnRJZDpteUNsaWVudFNlY3JldA==' \
--data-urlencode 'grant_type=client_credentials'

# Refresh Token generation Curl

curl --location 'http://localhost:1337/simple-auth/refresh-token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer b323177e47a266abc2d5d9cd42c08dcccdb9e365' \
--data-urlencode 'grant_type=refresh_token' \
--data-urlencode 'client_id=myClientId1' \
--data-urlencode 'client_secret=myClientSecret' \
--data-urlencode 'refresh_token=b323177e47a266abc2d5d9cd42c08dcccdb9e365'

# Static Builds API call

curl --location --globoff 'http://localhost:1337/api/countries' \
--header 'x-csrf-token: randomCSRFToken' \
--header 'Authorization: Bearer randomCSRFToken'


```

## Note

- Please replace appropriate token and Basic auth values to generate access token.
- For nextJS static builds, use x-csrf-token in header and same token to be sent in the authorisation header
  which will be generated using a secret key from .env file 

 ```
 X_CSRF_SECRET = "randomString"
 ```

## Features

- Currently only designed to prevent unauthorized access to strapi public apis
- Works entirely on the principle of OAuth Client Credentials.

## References

- [Component List - Strapi Helper Plugin](https://github.com/strapi/strapi/tree/master/packages/strapi-helper-plugin/lib/src/components)
- [Strapi Content Import Plugin](https://github.com/strapi/community-content/tree/master/tutorials/code/import-content-plugin-tutorial/plugins/import-content)
- [Guide to Strapi Content Import Plugin](https://strapi.io/blog/how-to-create-an-import-content-plugin-part-1-4?redirectPage=3)
- [Strapi Styled Component](https://design-system-git-develop-strapijs.vercel.app/)

---
_Source: https://npm.io/package/simple-strapi-auth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
