cpsit / api-token
Generate and validate token auth for api requests.
Installs: 6 741
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 14
Forks: 0
Open Issues: 0
Type:typo3-cms-extension
Requires
- dwenzel/t3extension-tools: ^1.7 || ^2.0
- ramsey/uuid: ^4.0
- typo3/cms-core: ^10.4||^11.5
Requires (Dev)
- nimut/testing-framework: ^5.2 || ^6.0
- roave/security-advisories: dev-latest
This package is auto-updated.
Last update: 2024-11-04 09:29:33 UTC
README
Generates API credentials
Generate by CLI command
./vendor/bin/typo3cms apitoken:generate
- Asks for token name, a descriptive help to identify record, no technical usage.
- Asks for token description, a descriptive help to identify record, no technical usage.
Puts out:
Your token was successfully generated.
Identifier: 4a6*******d
Secret: 7a5-*****c82
(Please keep information safely and secure. Token is shown only once.)
Persists name, description, identifier, date of expiration (1 year) and hash value to verify token by API call. Please note secret (token) securely, it will not be shown a second time.
Generate in Typo3 backend
tbd
Use in your extension
- Require extension:
composer req cpsit/api-token
- Implement Token check in your API Handler
if(\CPSIT\ApiToken\Request\Validation\ApiTokenAuthenticator::isNotAuthenticated($request)){
return \CPSIT\ApiToken\Request\Validation\ApiTokenAuthenticator::returnErrorResponse();
}
- Put into API request header
x-api-identifier = {your x-api-identifier generated above}
andapplication-authorization = {your secret token generated above}
License
Copyright notice
(c) 2021 Team Bravo info@familie-redlich.de All rights reserved
The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html. A copy is found in the text file GPL.txt and important notices to the license from the author is found in LICENSE.txt distributed with these scripts. This script is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. This copyright notice MUST APPEAR in all copies of the script!