Download the PHP package own3d/id without Composer

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

OWN3D ID

PHP OWN3D ID API Client for Laravel 5+

Table of contents

  1. Installation
  2. OAuth2 Documentation
  3. Remarks
  4. Socialite Event Listener
  5. Configuration
  6. Examples
  7. Documentation
  8. Development

Installation

Install the own3d id package with composer:

OAuth2 Documentation

You can find the documentation for OAuth2 here. There you can find all the information about registering your application and the scopes you can request.

Remarks

In the StreamTV / OWN3D ID Library all SSO IDs are defined as strings. This comes from the origin that all IDs should become UUIDs. We will simply continue the id assignment on big-integers, since we never implemented this step. We recommend to store all ids as big-integers (20) in your database. It is not guaranteed that we will assign IDs incrementally.

E-Mail Verification

Every oauth client needs to check itself if they need a (verified) email address from the user. The current email address can be fetched via /api/users/@me, it will be returned in the email attribute. To see if the email is verified by the user, you can lookup the email_verified_at attribute. If the email attribute is null, this means the user has no email associated with his account. You need to call /api/users/@me/update-email by yourself to assign and trigger the email verification process.

Socialite Event Listener

Configuration

Copy configuration to config folder:

Add environmental variables to your .env

You will need to add an entry to the services configuration file so that after config files are cached for usage in production environment (Laravel command artisan config:cache) all config is still available.

Add to config/services.php:

Examples

Basic

Setters

OAuth Tokens

Facade

Documentation

Oauth

Users

Events

OAuth Scopes Enums

Protecting Routes

Via Middleware

OWN3D ID includes an authentication guard that will validate access tokens on incoming requests. Once you have configured the api guard to use the own3d-id driver, you only need to specify the auth:api middleware on any routes that should require a valid access token:

Multiple Authentication Guards

If your application authenticates different types of users that perhaps use entirely different Eloquent models, you will likely need to define a guard configuration for each user provider type in your application. This allows you to protect requests intended for specific user providers. For example, given the following guard configuration the config/auth.php configuration file:

The following route will utilize the api-customers guard, which uses the customers user provider, to authenticate incoming requests:

Token Scopes

Scopes allow your application's users to limit the actions a third-party application can perform on their behalf. For example, not all API consumers will need the ability to fetch entitlements.

Defining Scopes

Scopes are registered globally by the OWN3D ID service. If a OWN3D first-party specific application needs a additional scope, then they need to define it in the OWN3D ID service.

Assigning Scopes To Tokens

When requesting an access token using the authorization code grant, consumers should specify their desired scopes as the scope query string parameter. The scope parameter should be a space-delimited list of scopes:

Requesting all Tokens

When using the password grant or client credentials grant, you may wish to authorize the token for all of the scopes supported by your application. You can do this by requesting the * scope. If you request the * scope, the can method on the token instance will always return true. This scope may only be assigned to a token that is issued using the password or client_credentials grant:

Checking Scopes

Using the scopes and scope middleware requires a authorization guard. For first-party apps, you may want to use a special authentication guard to create users dynamically. If you're interested in machine-to-machine authentication or want to skip the authorization guard, then have a look at client credentials grant tokens.

OWN3D ID includes two middleware that may be used to verify that an incoming request is authenticated with a token that has been granted a given scope. To get started, add the following middleware to the $routeMiddleware property of your app/Http/Kernel.php file:

Check For All Scopes

The scopes middleware may be assigned to a route to verify that the incoming request's access token has all of the listed scopes:

Check For Any Scopes

The scope middleware may be assigned to a route to verify that the incoming request's access token has at least one of the listed scopes:

Checking Scopes On A Token Instance

Once an access token authenticated request has entered your application, you may still check if the token has a given scope using the tokenCan method on the authenticated App\Models\User instance:

Client Credentials Grant Tokens

The client credentials grant is suitable for machine-to-machine authentication. For example, to performing maintenance tasks over an API.

Before your application can issue tokens via the client credentials grant, you will need to request a client credentials grant client. You may do this by writing to [email protected].

Next, to use this grant type, you need to add the CheckClientCredentials middleware to the $routeMiddleware property of your app/Http/Kernel.php file:

Then, attach the middleware to a route:

To restrict access to the route to specific scopes, you may provide a comma-delimited list of the required scopes when attaching the client middleware to the route:

Using OWN3D ID as API Guard

If you want to accept OWN3D ID Access tokens within you API Server, you can easily add/modify your guards, to enable support. If you also want to generate users automatically in your local database, then use the sso-users provider within your api guard.

config/auth.php:

After configure your guards, you need to register the own3d-id and sso-users drivers within your AuthServiceProvider.

Development

Run Tests

Generate Documentation


All versions of id with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
ext-json Version *
illuminate/support Version ~5.4|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/console Version ~5.4|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
guzzlehttp/guzzle Version ^6.3|^7.0
socialiteproviders/manager Version ^3.4|^4.0.1
doctrine/dbal Version ^2.10|^3.6|^4.0
firebase/php-jwt Version ^6.2
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 own3d/id contains the following files

Loading the files please wait ....