marshmallow/authenticator

A package to simply authenticate with differt platforms like Instagram, Zoho Desk, Facebook etc.

v1.2.0 2023-01-16 16:39 UTC

This package is auto-updated.

Last update: 2024-12-16 20:32:17 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package makes it super easy to authenticate with different api's. As of this moment we only support Instagram auth but we will add more as soon as we need them, and that should be soon. Just run Authenticator::instagramToken()->refresh()->getAccessToken() and you have your token available.

Installation

You can install the package via composer:

composer require marshmallow/authenticator

You can publish and run the migrations with:

php artisan vendor:publish --provider="Marshmallow\Authenticator\AuthenticatorServiceProvider" --tag="authenticator-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --provider="Marshmallow\Authenticator\AuthenticatorServiceProvider" --tag="authenticator-config"

This is the contents of the published config file:

return [
    'instagram' => [
        'client_id' => env('AUTH_INSTAGRAM_CLIENT_ID', null),
        'client_secret' => env('AUTH_INSTAGRAM_CLIENT_SECRET', null),
        'redirect_uri' => env('AUTH_INSTAGRAM_REDIRECT_URI', null),
    ],
];

Usage

You can run the command below to start the authentication process with Instagram. Follow the steps in your command line and this package will do the magic for you.

php artisan auth:instagram

Once you've run the command above, you can get the access token from Instagram as shown below.

use Marshmallow\Authenticator\Facades\Authenticator;

Authenticator::instagramToken()->refresh()->getAccessToken();

Testing

composer test

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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