Download the PHP package vatsim/sso without Composer

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

VatsimSSO

Laravel 4 compatible, use version 2 for Laravel 5

The VatsimSSO package integrates with the VATSIM.net Single Sign On, which lets your users log themselves in using their VATSIM ID. This is especially useful for official vACCs and ARTCCs.

Version

1.0

Installation

Use Composer to install the VatsimSSO and dependencies.

Laravel

Set up

Using VatsimSSO in Laravel is made easy through the use of Service Providers. Add the service provider to your app/config/app.php file:

Followed by the alias:

Configuration file

Use artisan to publish the configuration file. After running the command you will find the file in app/config/packages/vatsim/sso/config.php. Change the settings accordingly.

Outside Laravel

Let's first create a configuration file to keep our code clean.

Now, let's initialise the SSO class.

Usage

Logging In

The first step would be to send a request to VATSIM to let the user login. The easiest approach would be using the login function. The function takes three parameters.

Parameters

Parameter Type Description
$returnUrl string | array The URL to which the user should be redirected after the login is successful
$success string | Closure Callback function containing the actions needed to be done when you are able to let the user authenticate (ie. when your key/secret are correct). The function will return three variables: $key, $secret and $url.
$error string | Closure Default: null – Callback function containing the actions needed to be done when your credentials (ie. key/secret) are incorrect.

For both $success and $error, you may pass a string in [class]@[method] format to call a function in another Model, otherwise pass an anonymous function.

Return URL

The return URL parameter will also take an array instead of a string. In this array you can add the values suspended and/or inactive to allow members with suspended or inactive accounts to log in. The first element of this array that is a valid URL will be used as the return URL.

Success

The success parameter returns three variables: $key, $secret and $url. The key and secret should be stored in a session for the validation process. The url will be used to redirect the user to the VATSIM SSO site.

Error

Optional parameter. If this parameter is ignored and an error occurs, the function will return false. If you pass a function then one parameter will be returned $error, which is an array of data related to the last error.

Example

If you prefer not to use the ->login() function, you may use ->requestToken($returnUrl). This will return an object containing the key and secret or returns false if an error occurs, at that point you can use ->error() to get the array of the last occured error. Then use ->sendToVatsim() to get the URL for the redirect.

Validating login

After the login has been successful, we need to get the user data from VATSIM. Also for this we wrote a function to make it easier for you.

Parameters

Parameter Type Description
$key string The key stored in the session at login
$secret string The secret stored in the session at login
$verifier string The oauth_verifier passed in the query string
$success string | Closure Callback function containing the actions needed to be done when the login has been successful.
$error string | Closure Default: null – Callback function containing the actions needed to be done when authentication was unsuccessful (could be because of wrong key/secret/verifier)

For both $success and $error, you may pass a string in [class]@[method] format to call a function in another Model, otherwise pass an anonymous function.

Success

The success parameter returns two variables: $user and $request. The user variable will be an object containing all user data available to your organisation. The request variable will give you information about the request.

Error

Optional parameter. If this parameter is ignored and an error occurs, the function will return false. If you pass a function then one parameter will be returned $error, which is an array of data related to the last error.

Example

If you prefer not to use the ->validate() function, you may use ->checkLogin($key, $secret, $verifier). This will return an object containing the user and request objects or returns false if an error occurs, at that point you can use ->error() to get the array of the last occured error.

License

MIT

Free Software, Hell Yeah!


All versions of sso with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
bonroyage/oauth Version 1.*
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 vatsim/sso contains the following files

Loading the files please wait ....