Download the PHP package beziworld/laravel-autenti without Composer
On this page you can find all versions of the php package beziworld/laravel-autenti. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download beziworld/laravel-autenti
More information about beziworld/laravel-autenti
Files in beziworld/laravel-autenti
Package laravel-autenti
Short Description Autenti e-signature API v2 for Laravel: document processes, participants, files, sending, action links, signed file download, JWT bearer auth and JWS-verified callbacks.
License MIT
Homepage https://github.com/beziworld/laravel-autenti
Informations about the package laravel-autenti
Laravel Autenti
Autenti electronic signatures for Laravel, built on the public Autenti Document Process API v2:
- OAuth2 JWT bearer grant with an RS256/RS512 assertion signed by your key pair, client credentials (secret or client assertion), tokens cached per client and user, acting as another user of the organisation
- document processes ("envelopes"): list with filters, details, drafts with participants, signing order, signature type (basic, advanced, qualified), SMS verification, return URL and expiration
- files: upload (multipart
fileMeta+file), list, remove, download any version, download the signed result - actions: send, withdraw, remind (with automatic participant selection), discovery of available actions, generic challenge-assertion actions, action history
- participant action links (signing links) with a redirect URL
- callbacks: registration, listing, deletion,
autenti:callbackscommand and a route that verifies thex-jws-signature(detached JWS, RS256) with the public keys Autenti publishes, then dispatches Laravel events - acceptance and production environments, many API clients through named and runtime connections
Polska wersja dokumentacji
Why this package
At the time of writing there was no PHP or Laravel client for Autenti on Packagist or GitHub (the similarly named
autentique packages target an unrelated Brazilian service). Integrating the API by hand means implementing the
RFC 7523 JWT assertion, the challenge-assertion action model with base64 headers, multipart uploads with typed parts
and detached JWS verification against a JWKS. This package does all of that with the Laravel HTTP client
(Http::fake works) and typed data objects.
The API is available for Autenti PRO, PREMIUM and ENTERPRISE plans.
Installation
The JWT bearer grant authenticates the user given by AUTENTI_USER_EMAIL, who must belong to the organisation of the
API client. The assertion contains aud: autenti.com, email, email_verified: true, iat and a five minute
exp; Autenti rejects assertions whose iat is more than 60 seconds off, so keep the server clock synchronised.
Generate the key pair with openssl genrsa -out private.pem 2048 and openssl rsa -in private.pem -pubout and
register the public key with Autenti.
Sending a document
Step by step: createDocument() creates a draft, addFile() / addFileFromPath() upload source files (20 MB in
total), send() sends it. Drafts can be changed with updateDocument(), addParticipant(), removeParticipant()
and removeFile(). Writes are never retried automatically.
Status, files and links
Callbacks and events
Register the package route once (the organisation may have up to 5 callbacks; the super administrator scope
notification_management is required):
Autenti posts a JSON list of events with an x-jws-signature header. The route verifies the detached JWS with the
key set of the environment (autenti.com/developers/keys/webhook.jwks or accept-webhook.jwks, cached for a day and
fetched again on an unknown key) and dispatches:
| Event | Autenti event type |
|---|---|
AutentiEventReceived |
every event |
DocumentCompleted |
DOCUMENT_PROCESS_COMPLETED |
DocumentRejected |
DOCUMENT_PROCESS_REJECTED |
DocumentWithdrawn |
DOCUMENT_PROCESS_WITHDRAWN |
DocumentExpired |
DOCUMENT_PROCESS_EXPIRED |
SigningCompleted |
SIGNING_PROCESS_COMPLETED |
ApprovalConsented |
APPROVAL_PROCESS_CONSENTED |
ReviewCompleted |
REVIEW_PROCESS_COMPLETED |
SigningHandedOver |
DOCUMENT_SIGNING_HANDED_OVER |
Callbacks are tenant wide (documents sent from the Autenti UI arrive too) and are repeated until HTTP 2xx
(immediately, after 30 minutes, 6 hours and 24 hours), so listeners must be idempotent. Forged callbacks get
HTTP 403, malformed ones HTTP 400. For a custom route use Autenti::parseCallback($rawBody, $signatureHeader).
Many clients and users
Errors
| Exception | When |
|---|---|
InvalidConfiguration |
missing client id, secret, user e-mail or private key; unknown grant, environment or connection; unusable key |
AuthenticationFailed |
token request rejected (error() such as invalid_client, invalid_grant; requiresMultiFactor()) |
ApiException |
HTTP error with the Autenti type() (e.g. /error/resource-not-found), instance(), retryAfter(), or a connection failure |
ChallengeRequired |
HTTP 403 with an X-Challenge the call did not answer; challenge() describes it |
InvalidRequest |
data violates a documented constraint (e-mail, NIP, title, limit 128, offset 256, HTTPS callback) |
InvalidCallback |
missing or invalid x-jws-signature, unknown key, malformed body |
All extend AutentiException. Reads are retried on connection errors and HTTP 5xx; HTTP 429 is never retried
automatically, as the API terms require.
Development
Tests generate throwaway RSA keys at runtime (phpseclib) and verify the callback example of the official documentation with the published production key.
Author
Created and maintained by Kamil Ćwiertnia, beziworld.eu.
- E-mail: [email protected]
- Issues: GitHub issues
- Security vulnerabilities: see SECURITY.md
Need an integration? Get in touch through beziworld.eu.
Other packages by the author
laravel-edoreczenia · laravel-ksef · laravel-fakturownia · laravel-comfino
License
MIT. See LICENSE.md. This package is not affiliated with Autenti sp. z o.o.
All versions of laravel-autenti with dependencies
ext-json Version *
ext-openssl Version *
guzzlehttp/guzzle Version ^7.8
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/routing Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0