Download the PHP package polaris/sso without Composer

On this page you can find all versions of the php package polaris/sso. 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 sso

polaris/sso

SSO for Polaris for PHP: per-organization SAML 2.0 and OpenID Connect providers, verified domains that route an email to its organization's provider, just-in-time users and memberships, single logout in both directions, the organization's own self-service routes and the operators' view. No operator is needed to onboard an organization's identity provider.

polaris/audit and polaris/admin are required and must be registered too: every action is an sso.* event in the audit store, and the operator routes use the admin plugin's principals. baseUrl is where Polaris is mounted, prefix included: the SP entity id, the assertion consumer and single-logout URLs and the OIDC redirect URI derive from it. OIDC needs the PSR-18 client and PSR-17 factories (discovery, the token endpoint, the JWKS); SAML needs nothing more. In Laravel, Symfony and Yii the three instances go in the adapter's plugins configuration; the two tables (polaris_sso_provider, polaris_sso_domain) join polaris:install, schema:create and schema:diff, the routes join the route table.

The sign-in

  1. The application calls POST /sso/sign-in with the user's email (a verified domain routes it to its provider) or a provider_id, and optionally the redirect_uri the sign-in should end on (one of the provider's; the first by default). It answers {data: {url, provider_id, type}}; the application sends the browser to url.
  2. The provider authenticates the user and sends the browser back to the callback (GET /sso/callback/{providerId} for OIDC, POST for SAML). Polaris validates what came back, finds the user by email or creates them (when the provider provisions), makes sure they are a member of the organization, opens a session scoped to that organization (amr: ["sso"]) and answers 302 <redirect_uri>?sso_code=.... Tokens never travel in a URL.
  3. The application calls POST /sso/exchange with the code, once, within a minute, and receives the login envelope (access_token, refresh_token, user), as /auth/login answers it.

A rejected assertion or token answers 403 sso/assertion_invalid with a generic detail; the reason is in the audit trail (sso.assertion_rejected). Every rejection and sign-in is audited; a sign-in is also core's UserLoggedIn, a provisioned membership core's MemberJoined.

What is checked

Provisioning

A user is found by the asserted email. When none exists and the provider's jit.enabled is set, the user is created with the email verified (the provider vouched for the mailbox), no password, the display name from the mapped attribute; otherwise 403 sso/user_unknown. A missing membership is created with the roles of jit.roles (slugs of the organization's roles, member by default); a suspended membership refuses the sign-in; a disabled account too.

Routes

Route Who Does
POST /sso/sign-in {email \| provider_id, redirect_uri?} public where to send the browser
GET /sso/callback/{providerId}?code&state public the OIDC callback; 302 redirect_uri?sso_code=
POST /sso/callback/{providerId} SAMLResponse, RelayState public the SAML assertion consumer; 302 redirect_uri?sso_code=
POST /sso/exchange {code} public the login envelope, once
GET /sso/metadata/{providerId} public the SP metadata XML (application/samlmetadata+xml)
GET\|POST /sso/slo/{providerId} public an IdP's signed LogoutRequest ends the user's sessions and is answered with the LogoutResponse redirect; an IdP's LogoutResponse ends an application-initiated logout
POST /sso/logout {provider_id?, organization_id?, post_logout_uri?} bearer the caller's sessions end; url is the IdP's single-logout (SAML LogoutRequest or OIDC end-session), null when the provider offers none
GET\|POST /orgs/{id}/sso/providers, GET\|PATCH\|DELETE /orgs/{id}/sso/providers/{providerId}, POST .../test org.update in the active organization the organization's providers (below)
GET\|POST /orgs/{id}/sso/domains, POST /orgs/{id}/sso/domains/{domainId}/verify, DELETE /orgs/{id}/sso/domains/{domainId} org.update the organization's domains
GET /admin/sso/providers?organization_id=&cursor=&limit=, DELETE /admin/sso/providers/{id} admin read / own every organization's providers, for the operators

The organization routes are core's: auth: bearer with org.update, and the path's organization must be the token's active one (a superadmin excepted). Their errors are problem documents (sso/forbidden, sso/not_found, sso/invalid_input with errors, sso/conflict, sso/domain_unverified); the public flow's are sso/provider_not_found, sso/provider_disabled, sso/invalid_input, sso/assertion_invalid, sso/user_unknown, sso/account_disabled, sso/membership_suspended, sso/code_invalid. The TypeScript client has every route as client.sso.*.

A provider

A domain

POST /orgs/{id}/sso/domains {domain, provider_id} claims a domain for a provider (one organization per domain across the instance) and answers a token with two ways to prove it: a DNS TXT record _polaris.<domain> or the file https://<domain>/.well-known/polaris-sso.txt, either carrying the token. POST .../verify checks DNS then HTTPS (DomainVerifier, the system resolver and the plugin's PSR-18 client; your own implementation goes in domains:). Once verified, POST /sso/sign-in {email} routes the domain's emails to the provider.

Configuration

Short-lived state (the OIDC state, nonce and PKCE verifier, the SAML request ids, the assertion ids seen, the hand-off codes) lives in the graph's cache: share it across web nodes as you share core's rate store.

License

MIT. Polaris for PHP is created and maintained by 2am.tech.


All versions of sso with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
ext-dom Version *
ext-openssl Version *
firebase/php-jwt Version ^7.0
onelogin/php-saml Version ^4.3
polaris/admin Version ^0.12
polaris/audit Version ^0.12
polaris/core Version ^0.12
psr/clock Version ^1.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
psr/log Version ^3.0
psr/simple-cache Version ^3.0
symfony/uid Version ^7.0 || ^8.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 polaris/sso contains the following files

Loading the files please wait ...