Empower your applications with secure token authentication using our PHP-based RESTful API. Effortlessly manage authentication tokens, set usage limits, and ensure data security.
Feature | Description |
---|---|
Token Creation | Create authentication tokens with configurable limits. |
Token Validation | Validate tokens to ensure secure access to resources. |
Usage Limit | Set usage limits for tokens to control access. |
Security Measures | Implement security measures to prevent unauthorized access. |
Modular Design | Organized code structure for easy maintenance and scalability. |
JSON Data Storage | Store authentication keys and usage counts in JSON files for persistence. |
-
Get Authentication Keys (Tokens):
- Endpoint:
/api_request.php/tokens?security=your_security_token_here
- Method: GET
- Returns: JSON object containing authentication keys.
- Endpoint:
-
Create Token:
- Endpoint:
/api_request.php/createtoken
- Method: POST
- Parameters:
token
: The token to create.limit
(optional): Usage limit for the token.security
: Security token for authorization.
- Returns: Success message upon token creation.
- Endpoint:
-
Validate Token:
- Endpoint:
/api.php?token=your_token_here
- Method: GET
- Returns: Success message if token is valid, else Unauthorized error.
- Endpoint:
-
Clone the repository:
git clone https://github.com/your_username/token-auth-api.git
-
Navigate to the project directory:
cd TRestAPI
-
Configure the security token:
- Open
api_request.php
and set the$securityToken
variable to your desired security token value.
- Open
-
Run the PHP server:
php -S localhost:5000
-
Access the API endpoints using cURL or an HTTP client.
Contributions are welcome! Fork the repository, make your changes, and submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.