{"id":18034629,"url":"https://github.com/austinkregel/laravel-flight","last_synced_at":"2025-10-28T12:24:03.897Z","repository":{"id":143585931,"uuid":"615124191","full_name":"austinkregel/laravel-flight","owner":"austinkregel","description":"Secure your Laravel Projects using Oauth. All you have to do is update your oauth settings with this package.","archived":false,"fork":false,"pushed_at":"2024-07-22T14:19:53.000Z","size":78,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T08:22:01.895Z","etag":null,"topics":["authentication","hacktoberfest","laravel","laravel-package","laravel-socialite","oauth","socialite"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/austinkregel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-17T02:05:46.000Z","updated_at":"2024-07-22T14:18:58.000Z","dependencies_parsed_at":"2023-05-04T17:47:40.445Z","dependency_job_id":"66b12452-1c00-4d0c-888a-91f1a041625d","html_url":"https://github.com/austinkregel/laravel-flight","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austinkregel%2Flaravel-flight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austinkregel%2Flaravel-flight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austinkregel%2Flaravel-flight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austinkregel%2Flaravel-flight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/austinkregel","download_url":"https://codeload.github.com/austinkregel/laravel-flight/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245797575,"owners_count":20673886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","hacktoberfest","laravel","laravel-package","laravel-socialite","oauth","socialite"],"created_at":"2024-10-30T11:13:01.722Z","updated_at":"2025-10-28T12:23:58.859Z","avatar_url":"https://github.com/austinkregel.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stop publishing apps with public horizon access.\n\nSecure your apps easily with Laravel Socialite and OAuth. Install this package, configure a few env values, a config/services.php entry, and then login. Never leave your apps unprotected.\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/kregel/laravel-flight.svg?style=flat-square)](https://packagist.org/packages/kregel/laravel-flight)\n[![Total Downloads](https://img.shields.io/packagist/dt/kregel/laravel-flight.svg?style=flat-square)](https://packagist.org/packages/kregel/laravel-flight)\n\nStreamline your Authentication even further. Integrate with your own internal Laravel Passport instance and enable your users to login however they need to.\n\nStop dealing with setting up a /login redirect and /callback. Not all apps need their own auth system.\nSometimes we just want to login with an existing platform like Github, Auth0, or even a custom Laravel Passport instance.\nWhile this still does have it's own user's table, it's largely used for tracking social users.\n\n\n### Ok but why?\nBecause there are Laravel tools out there that don't come with authentication, but require it to be able to secure them for production access.\n\nThis package let's you grab your favorite Github, Google, or other supported OAuth provider's credentials, set them in your env, visit `http://yoururl/flight/login` and login. You should be redirected to the auth provider you chose as your `FLIGHT_DRIVER`, and you will then be redirected to `FLIGHT_LOGIN_REDIRECT`.\n\nUsers that don't exist at the time of the request will be created unless you explicitly disable registration with an env var (so turn it off after you registery) `FLIGHT_ALLOW_REGISTRATION`\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require kregel/laravel-flight\n```\n\nPublish the config\n\n```\nphp artisan vendor:publish --provider=Kregel\\\\Flight\\\\FlightServiceProvider\n```\nFind a [socialite provider](https://socialiteproviders.com/about/) you wish to use\n\nAdd their ExtendSocialite event to our config file under the `community_drivers` section, and if you wish to make it your primary driver, set your `FLIGHT_DRIVER`\n\n## Post setup\nYou'll want to verify that you have your  `web` middleware configured. And you'll want the `auth` middleware too, so Laravel will redirect you to your auth provider.\n\nIf you're reading a headless type of system and have removed those middlewares here's basically the same stuff.\n\nIn your `app/Http/Kernel.php` the `web` middleware would basically be \n```php\n    protected $middlewareGroups = [\n        'web' =\u003e [\n            \\Illuminate\\Cookie\\Middleware\\EncryptCookies::class,\n            \\Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse::class,\n            \\Illuminate\\Session\\Middleware\\StartSession::class,\n            \\Illuminate\\View\\Middleware\\ShareErrorsFromSession::class,\n            \\Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToke::class,\n            \\Illuminate\\Routing\\Middleware\\SubstituteBindings::class,\n        ],\n    ];\n```\n\nAnd under the `$middlewareAliases` portion you can add the following replacement for `App\\Http\\Middleware\\Authenticate`\n\n```php\n'auth' =\u003e \\Kregel\\Flight\\Middleware\\Authenticate::class,\n'guest' =\u003e \\Kregel\\Flight\\Middleware\\RedirectIfAuthenticated::class,\n```\nBoth of the above middleware are almost directly taken from the base Laravel app, with minor adjustments for configuration.\n\n## Integrating new socialite providers\nTo add a new authentication provider to your app, you'll need to `composer require` their package into your app,\nthen add their ExtendSocialite listener to the `community_drivers` page. Once the driver has been added, you'll need\nto open your `config/services.php` file and add the following equivalent for your driver\n. Replacing `driver_name` and `DRIVER_NAME` with your actual driver.\n```php\n'driver_name' =\u003e [\n    'client_id' =\u003e env('DRIVER_NAME_CLIENT_ID'),\n    'client_secret' =\u003e env('DRIVER_NAME_CLIENT_SECRET'),\n    'redirect' =\u003e env('DRIVER_NAME_REDIRECT_URI'),\n],\n```\n\nIf your preferred driver is github, then it'll look like this:\n```php\n'github' =\u003e [\n    'client_id' =\u003e env('GITHUB_CLIENT_ID'),\n    'client_secret' =\u003e env('GITHUB_CLIENT_SECRET'),\n    'redirect' =\u003e env('GITHUB_REDIRECT'),\n],\n```\n\nLastly, change your `FLIGHT_DRIVER` env var to your preferred driver.\n\nAnd visit `http://yourwebsite/flight/login`\n\nIf you haven't already set up the redirect url or callback url  `http://yourwebsite/flight/callback`\n\n### Testing\n\n```bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email 5355937+austinkregel@users.noreply.github.com instead of using the issue tracker.\n\n## Credits\n\n-   [Austin Kregel](https://github.com/kregel)\n-   [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## Laravel Package Boilerplate\n\nThis package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustinkregel%2Flaravel-flight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faustinkregel%2Flaravel-flight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustinkregel%2Flaravel-flight/lists"}