Download the PHP package agungsugiarto/codeigniter4-socialite without Composer

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

About

CodeIgniter4 Socialite is Forked from Laravel Socialite wrapper around OAuth 1 & OAuth 2 libraries for working with codeigniter4 compatibility.

Introduction

CodeIgniter4 Socialite provides an expressive, fluent interface to OAuth authentication with Facebook, Google, LinkedIn, GitHub, GitLab and Bitbucket. It handles almost all of the boilerplate social authentication code you are dreading writing.

Installation

To get started with Socialite, use the Composer package manager to add the package to your project's dependencies:

Configuration

Copy the config file from vendor/agungsugiarto/codeigniter4-socialite/src/Config/Socialite.php to config folder of your codeigniter4 application change the namespace to Config and change class extends from BaseConfig to \Fluent\Socialite\Config\Socialite

Before using Socialite, you will need to add credentials for the OAuth providers your application utilizes. These credentials should be placed in your application's app/Config/Socialite.php configuration file, and should use the key facebook, linkedin, google, github, gitlab, or bitbucket, depending on the providers your application requires:

If the redirect option contains a relative path, it will automatically be resolved to a fully qualified URL.

Authentication

Routing

To authenticate users using an OAuth provider, you will need two routes: one for redirecting the user to the OAuth provider, and another for receiving the callback from the provider after authentication. The example controller below demonstrates the implementation of both routes:

The redirect method provided by the Socialite facade takes care of redirecting the user to the OAuth provider, while the user method will read the incoming request and retrieve the user's information from the provider after they are authenticated.

Optional Parameters

A number of OAuth providers support optional parameters in the redirect request. To include any optional parameters in the request, call the with method with an associative array:

When using the with method, be careful not to pass any reserved keywords such as state or response_type.

Access Scopes

Before redirecting the user, you may also add additional "scopes" to the authentication request using the scopes method. This method will merge all existing scopes with the scopes that you supply:

You can overwrite all existing scopes on the authentication request using the setScopes method:

Retrieving User Details

After the user is redirected back to your authentication callback route, you may retrieve the user's details using Socialite's user method. The user object returned by the user method provides a variety of properties and methods you may use to store information about the user in your own database. Different properties and methods may be available depending on whether the OAuth provider you are authenticating with supports OAuth 1.0 or OAuth 2.0:

Retrieving User Details From A Token (OAuth2)

If you already have a valid access token for a user, you can retrieve their details using Socialite's userFromToken method:

Stateless Authentication

The stateless method may be used to disable session state verification. This is useful when adding social authentication to an API:

Contributing

Thank you for considering contributing to Socialite!.

License

CodeIgniter4 Socialite is open-sourced software licensed under the MIT license.


All versions of codeigniter4-socialite with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0
ext-json Version *
guzzlehttp/guzzle Version ^6.0|^7.0
codeigniter4/framework Version ^4.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 agungsugiarto/codeigniter4-socialite contains the following files

Loading the files please wait ....