![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@strapi/plugin-users-permissions
Advanced tools
Protect your API with a full-authentication process based on JWT
@strapi/plugin-users-permissions is a plugin for Strapi, an open-source headless CMS. This plugin provides a robust system for managing user authentication, roles, and permissions. It allows developers to easily implement user registration, login, and role-based access control in their Strapi applications.
User Registration
This feature allows new users to register by providing a username, email, and password. The code sample demonstrates how to make a POST request to the registration endpoint.
fetch('/auth/local/register', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
username: 'exampleUser',
email: 'user@example.com',
password: 'password123'
})
})
.then(response => response.json())
.then(data => console.log(data));
User Login
This feature allows users to log in by providing their email (or username) and password. The code sample demonstrates how to make a POST request to the login endpoint.
fetch('/auth/local', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
identifier: 'user@example.com',
password: 'password123'
})
})
.then(response => response.json())
.then(data => console.log(data));
Role-Based Access Control
This feature allows administrators to define roles with specific permissions. The code sample demonstrates how to create a new role with permissions for creating and updating articles but not deleting them.
const role = {
name: 'Editor',
description: 'Can edit content',
permissions: {
'application::article.create': true,
'application::article.update': true,
'application::article.delete': false
}
};
fetch('/users-permissions/roles', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_ADMIN_TOKEN'
},
body: JSON.stringify(role)
})
.then(response => response.json())
.then(data => console.log(data));
Passport is a popular authentication middleware for Node.js. It provides a wide range of authentication strategies, including local, OAuth, and OpenID. Unlike @strapi/plugin-users-permissions, Passport is not tied to a specific CMS and can be used with any Node.js application.
jsonwebtoken is a library for generating and verifying JSON Web Tokens (JWT). It is often used for implementing token-based authentication in web applications. While @strapi/plugin-users-permissions uses JWT under the hood, jsonwebtoken provides a lower-level API for working directly with tokens.
acl is a Node.js module for managing user roles and permissions. It provides a flexible way to define access control lists (ACLs) for different resources. Unlike @strapi/plugin-users-permissions, acl is a more general-purpose library that can be integrated into any Node.js application.
FAQs
Protect your API with a full-authentication process based on JWT
The npm package @strapi/plugin-users-permissions receives a total of 774 weekly downloads. As such, @strapi/plugin-users-permissions popularity was classified as not popular.
We found that @strapi/plugin-users-permissions demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.