Download the PHP package larawizards/lara-oauth2-client without Composer

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

Lara OAuth2 Client

A Laravel package for OAuth2 client authentication with single sign-on (SSO) support, compatible with Laravel 10, 11, and 12. Includes seamless integration with Laravel Fortify and Jetstream.

Features

Installation

You can install the package via Composer:

Configuration

Quick Setup

  1. Install the package:

  2. Publish configuration:

  3. Configure your .env file:

  4. Run migrations:

Detailed Configuration

For complete configuration instructions, including:

See CONFIGURATION.md for detailed instructions.

Usage

Basic Usage

The package automatically registers routes for OAuth2 authentication:

Using the SSO Login Page

Simply redirect users to the SSO login route:

Or use the OAuth2 redirect directly:

Protecting Routes with Middleware

Use the oauth2.auth middleware to protect routes:

User Model Configuration

The package automatically maps OAuth2 user attributes to your user model. You can customize the mapping in config/lara-oauth2-client.php:

Make sure your user model has the necessary columns. You may need to create a migration:

Laravel Fortify Integration

  1. Enable Fortify integration in your .env:

  2. The package will automatically integrate with Fortify's login views.

Laravel Jetstream Integration

  1. Enable Jetstream integration in your .env:

  2. Publish Jetstream views (if not already done):

  3. The package will add an SSO login button to your Jetstream login page.

Customizing Views

Publish the views to customize them:

Views will be published to resources/views/vendor/lara-oauth2-client/.

Programmatic Usage

You can also use the OAuth2 client directly:

Configuration Options

All configuration options are available in config/lara-oauth2-client.php:

Option Description Default
client_id OAuth2 client ID -
client_secret OAuth2 client secret -
redirect_uri OAuth2 redirect URI /oauth2/callback
authorization_url OAuth2 authorization endpoint -
token_url OAuth2 token endpoint -
user_info_url OAuth2 user info endpoint -
scopes OAuth2 scopes ['openid', 'profile', 'email']
route_prefix Route prefix for OAuth2 routes oauth2
auto_create_users Automatically create users if they don't exist true
fortify_enabled Enable Fortify integration false
jetstream_enabled Enable Jetstream integration false
sso_login_enabled Enable SSO login page true

Testing

Run the test suite:

Or with PHPUnit:

For detailed testing instructions, see TESTING.md.

Security Best Practices

  1. Always use HTTPS in production for OAuth2 redirects
  2. Store client secrets securely - never commit them to version control
  3. Use environment variables for all sensitive configuration
  4. Enable CSRF protection - the package uses Laravel's built-in CSRF protection
  5. Validate state parameters - the package automatically validates state to prevent CSRF attacks
  6. Encrypt tokens - access and refresh tokens are automatically encrypted in the database

Requirements

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

The MIT License (MIT). Please see License File for more information.

Support

For support, please open an issue on GitHub or contact [email protected].


All versions of lara-oauth2-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/routing Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
guzzlehttp/guzzle 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 larawizards/lara-oauth2-client contains the following files

Loading the files please wait ...