Download the PHP package padosoft/laravel-iam-client without Composer

On this page you can find all versions of the php package padosoft/laravel-iam-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-iam-client

Laravel IAM — Client

The drop-in Laravel client for apps that delegate authorization to a Laravel IAM server.
iam.can / iam.auth middleware, a Gate adapter so $user->can() just works, decision caching — fail-closed by design.

Tests Latest Version on Packagist Total Downloads PHP Version

📖 Read the documentation →


Why this package

Laravel IAM centralizes who can do what into one Policy Decision Point (PDP): RBAC + ABAC + ReBAC, step-up assurance, tenant isolation, tamper-evident audit. But your consuming apps shouldn't have to learn any of that — they already speak Laravel: middleware, Gate, policies, $user->can().

laravel-iam-client is the bridge. You point it at your IAM server, and authorization decisions flow through the tools your app already uses:

It works in two modes with identical app code: local (the IAM server lives in the same app — the client calls the PDP in-process, zero network) or http (remote server — the client calls the Admin API). Swap a single env var to move from a modular monolith to a distributed deployment.

Fail-closed, always. Every transport (LocalDecider, HttpDecider) denies on any error — unreachable PDP, non-2xx, unparseable body, engine exception. There is no fail-open opt-out: an outage never opens the doors.

Features

Use cases

Installation

Publish the config:

Requirements: PHP 8.3+, Laravel 11/12+. Depends on padosoft/laravel-iam-contracts.

Quick start

1. Configure the transport

config/iam-client.php (publish it, then set env):

That's it — the service provider wires the right decider (with caching) and registers the middleware aliases and the Gate adapter automatically.

Use https in production (fail-closed). Credentials and the Bearer-carrying decision call never travel over plain http://: a non-https IAM_CLIENT_BASE_URL/IAM_CLIENT_OAUTH_URL (except loopback — localhost/127.0.0.1/::1) is denied rather than sending a secret or token in clear. Set IAM_CLIENT_ALLOW_INSECURE=true to lift this for local development only.

Authentication modes (choose one)

The SDK authenticates to the PDP in one of three ways (checked in this order of precedence):

2. Protect routes with iam.can

iam.auth ensures there's a resolvable subject (401 otherwise); iam.can denies with 403 when IAM says no — or when a step-up is required but not yet satisfied.

3. Use the Gate adapter (your existing code keeps working)

4. Ask IAM directly with the facade

5. Declare your permissions/roles: push a manifest

Apps that don't use spatie/laravel-permission declare their permission catalog + roles in a manifest file (versioned in your repo — it is your source of truth). Push it to IAM whenever it changes:

It submits to IAM's Admin API (authenticated with this client's own bearer — the token needs iam:manifests.submit). IAM diffs it: additive changes apply, a removal is gated for approval in the console and the removed role/permission is deprecated (kept for history, disabled), never deleted. Run it in CI on deploy for hands-off sync. See Keeping IAM in sync.

Delegated access: when an AI agent acts for a user

With the laravel-iam-agents module on the server, an agent never receives a user's token: it exchanges it (OAuth 2.0 Token Exchange, RFC 8693) for a short-lived delegated token carrying BOTH identities — sub = the user, act = the agent. This client is the enforcement half:

Three properties are non-negotiable and built in: a malformed delegated token throws (it never degrades to a single-subject check), delegated decisions are never cached (revocation freshness beats the extra round-trip), and the typ: delegated+jwt header is hygiene — the defence is server-side introspection.

This client is also the exchange half when your app is itself a registered agent (an orchestrator, a flow-ai runtime): TokenExchanger performs the RFC 8693 call, authenticating with the same private_key_jwt config (http.client_id + http.private_key — an agent has ONE identity):

And every request that passes iam.can.delegated hydrates Laravel Context: logs emitted downstream (and queued jobs, via Context's automatic dehydrate/hydrate) carry iam_delegation — sub, the act chain, the grant id — so cross-package audit queries ("everything agent X did, for anyone") join for free.

How it fits the ecosystem

Package Role
laravel-iam-contracts Shared interfaces & DTOs — the dependency root
laravel-iam-server The IAM server: identity, PDP, OAuth/OIDC, audit, governance, Admin API & panel
laravel-iam-client (this repo) Consumer SDK: iam.can/iam.auth middleware, Gate adapter, decision caching
laravel-iam-ai Optional AI module: advisory-only governance (redaction + hallucination guard + audit)
laravel-iam-directory Optional directory module: LDAP / Active Directory (LdapRecord); SCIM in v2
laravel-iam-bridge-spatie-permission Migration bridge from spatie/laravel-permission: scan, shadow mode, decision diffing, cutover

Documentation

Full documentation is published at doc.laravel-iam-client.padosoft.com — quickstart, guides (iam.can, the Gate adapter, the facade, transports, ReBAC, step-up, caching), the fail-closed theory, architecture + ADRs, and a complete PHP/config reference. The source for that site lives in docs/.

Security

This client is fail-closed by design: any transport error, unreachable PDP, non-2xx response or engine exception resolves to deny — never an allow, never an opaque 500. Step-up-required permits are treated as not-yet-granted. There is no fail-open switch. If you discover a security issue, please email [email protected] rather than opening a public issue.

License

MIT © Padosoft. See LICENSE.


All versions of laravel-iam-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
padosoft/laravel-iam-contracts Version ^1.3
spatie/laravel-package-tools Version ^1.16
lcobucci/jwt Version ^5.0
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package padosoft/laravel-iam-client contains the following files

Loading the files please wait ...