Skip to content

Adds another security layer to the Strapi CMS admin and GraphQL/REST API endpoints.

License

Notifications You must be signed in to change notification settings

thomaspockrandt/strapi-plugin-basic-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Strapi Plugin Basic Authentication

Basic Authentication Middleware for Strapi CMS

Integration

Enable the plugin by adding it to the plugins configurations file:

// path: /path/to/myDevelopmentProject/config/plugins.js

module.exports = {
  // ...
  'strapi-plugin-basic-auth': {
    enabled: true,
    resolve: './src/plugins/strapi-plugin-basic-auth'
  },
  // ...
}

Admin User Interface

Use your regular Strapi CMS user to login with basic authentication.

Programmatic access (Serverless Function, ..)

curl "https://localhost:1337/graphql" \
     -H 'x-api-key: X_API_KEY'

X_API_KEY is set as environment variable on the Strapi CMS host.