Download the PHP package mohemian/flink-sdk-php without Composer
On this page you can find all versions of the php package mohemian/flink-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package flink-sdk-php
flink-sdk-php
Verify FLINK's signed assertions in a Laravel backend. An embedded FLINK journey hands your page the applicant's eID data (from ID Austria, for example) together with a copy signed by FLINK. This package verifies that signed copy, so your backend can check that the names and birthdate in a submitted form are the ones the eID returned. The same verifier checks FLINK's other signed assertions, such as a session's results.
Using Statamic? Follow docs/statamic.md end to end.
Install
PHP 8.2+ (8.3+ for Laravel 13), Laravel 10 to 13, ext-intl.
Verify a prefill
On the page, launch the journey with this session's reference and post prefillJwt from onResult
to your backend (see the
browser SDK docs):
On the backend:
Or as a validation rule, which keeps the verified prefill for you:
Flink::prefill() throws a FlinkException unless every one of these holds:
- signed by FLINK: RS256 only, key chosen by
kidfrom FLINK's JWKS (cached a day, refetched at most once a minute for an unknownkid), headertyp=flow-prefill+jwt; otherwiseInvalidSignature, orInvalidAssertionfor anothertyp iss=FLINK_URL,aud= your page's origin, not expired,ver= 1 (iatandexpallow 5 seconds of clock skew)tenant_idis yours andjourneyis one ofFLINK_JOURNEYS: any FLINK tenant can register your origin, soaudalone is not enoughmethodis one you accept (prefill.allowed_methods, default['eid']).eidis any eID provider route (ID Austria, SkIDentity or SK Authentigate); the claim does not say which onereferenceis this session's (or the one you pass as the second argument), so a JWT copied from someone else's browser fails
Everything but the signature is an InvalidAssertion. Two failures are deliberately not a
FlinkException, because a broken setup should fail loudly rather than refuse every applicant
quietly: MissingConfiguration for an unset variable, and KeysUnavailable when FLINK's keys cannot
be fetched (a wrong FLINK_URL, or an outage).
A journey with no identity step (email only, say) issues a JWT without method, and the prefill is
refused. That is deliberate: nothing in such a JWT is identity-backed, the email address included,
so it cannot stand in for a verified identity.
changed() returns the verified fields the submission changed or left out, as dotted keys; pass
only: to compare a subset. It compares strings after trimming and Unicode NFC normalisation, and
nothing more. Which changes you accept is your policy: docs/statamic.md locks
names and birthdate and lets the address change.
Flink::reference() issues this session's reference on first use (@flinkReference in Blade),
Flink::forgetReference() rotates it, so one journey run backs one submission. $prefill->id is
the JWT's jti: the same on every retry of one release, so to be sure of one submission per
release regardless of the session, accept each id once.
The JWT is personal data that stays verifiable after it expires: send it in a request body, verify it as soon as it arrives (it expires 5 minutes after the journey ends), and do not log or store it.
Verify any FLINK assertion
Every assertion FLINK signs verifies the same way; the caller always names the type it expects, so one type is never accepted as another (a results assertion never expires, so accepting it as a prefill would make it replayable forever):
Testing your app
Flink::fake() verifies against a key generated for the test, and signs assertions your config
accepts, so your tests never reach FLINK:
Operations
php artisan flink:keys:clearforgets the cached keys, so the next verification fetches them.php artisan aboutshows the FLINK settings.- Set
flink.eventsto dispatchAssertionVerifiedandAssertionRejectedfor an audit log. The rejection carries the expected type, the reason and the exception class as strings, never the JWT or its claims, so a queued listener can take it. flink.cachepicks the store, key and lifetime of the cached keys;FLINK_JWKS_URLoverrides where they come from.
Develop
License
MIT
All versions of flink-sdk-php with dependencies
ext-intl Version *
ext-openssl Version *
firebase/php-jwt Version ^7.0
guzzlehttp/guzzle Version ^7.2|^8.0
illuminate/cache Version ^12.0|^13.0
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/events Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/session Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
illuminate/validation Version ^12.0|^13.0