Download the PHP package cuongcds/ci3-open-sso without Composer

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

cuongcds/ci3-open-sso

Generic OAuth-style "Login via SSO" client for CodeIgniter 3 apps: builds the login redirect URL and handles the callback token exchange against any provider that speaks this simple protocol (GET /login?callback=...&client_id=... followed by a GET /oauth/token exchange). Extracted from a production CI3 app's SSO controller so the same flow can be reused across projects.

Install

The second command copies this SDK's ready-to-use application/config/open-sso.php, application/controllers/Opensso_oauth.php and application/views/plugins/open-sso/ into your project's own application/ directory (never overwrites existing files — pass --force to replace them). See examples/README.md for what's copied and the remaining manual steps (routes, mapping the SSO user to your own user table).

Why a redirect store abstraction?

Some SSO providers do not forward query parameters placed on the callback URL correctly — e.g. appending their own ?token=... with a bare ? instead of &, so a callback URL that already has ?redirect=... ends up corrupted (...?redirect=foo?token=bar, which PHP parses as a single garbage redirect value, silently dropping the token). Because of this, the "where to send the user after login" value must never be carried on the callback URL — it has to be stashed on your side (session, by default) before leaving for the provider and read back on return. This is exactly what Ci3Open\Sso\Storage\RedirectStoreInterface is for.

Usage

Starting login

Handling the callback

Ready-to-copy files (controller, view, config) are in examples/application — see examples/README.md for the copy commands.

Forcing SSO-only login/register

In your login/register controller actions, before rendering the form:

Custom redirect storage

The default SessionRedirectStore wraps CI3's session library. Implement Ci3Open\Sso\Storage\RedirectStoreInterface (put() / pullAndClear()) to back it with something else (e.g. a signed cookie) if needed.

Custom HTTP transport

The client uses a cURL-based transport by default. Swap it by implementing Ci3Open\Sso\Http\HttpClientInterface and passing it as the third constructor argument to SsoClient.

Errors

Reference

This SDK was extracted from a CI3 app's Oauth controller after diagnosing a bug where the post-login redirect target was lost — see the "Why a redirect store abstraction?" section above for the root cause.


All versions of ci3-open-sso with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-json Version *
ext-curl Version *
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 cuongcds/ci3-open-sso contains the following files

Loading the files please wait ...