simple-strapi-auth

1.0.15 • Public • Published

Strapi plugin simple-strapi-auth

Working on Strapi version: v4..

First Setup

  1. Install as an npm dependency
# install dependencies
npm install simple-strapi-auth
  1. Check the below api's to generate token and refresh token
# 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'

Note

  • Please replace appropriate token and Basic auth values to generate access token.

Features

  • Currently only designed to prevent unauthorized access to strapi public apis
  • Works entirely on the principle of OAuth Client Credentials.

References

Readme

Keywords

none

Package Sidebar

Install

npm i simple-strapi-auth

Weekly Downloads

92

Version

1.0.15

License

MIT

Unpacked Size

31.8 kB

Total Files

42

Last publish

Collaborators

  • pdalvi1893
  • siddhesh_shetye