Skip to content

Commit d82f368

Browse files
Update README.md
1 parent 977161b commit d82f368

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
1-
# laravel-azure-middleware
1+
# Laravel Azure Middleware
2+
3+
Provides Azure Authentication Middleware for a Laravel App.
4+
5+
## Installation
6+
7+
1. `composer require rootinc/laravel-azure-middleware`
8+
2. In our routes folder (most likely `web.php`), add ```Route::get('/login/azure', '\RootInc\LaravelAzureMiddleware\Azure@azure');Route::get('/login/azurecallback', '\RootInc\LaravelAzureMiddleware\Azure@azurecallback');```
9+
3. In our `App\Http\Kernel.php` add `'azure' => \RootInc\LaravelAzureMiddleware\Azure::class,` most likely to the `$routeMiddleware` array.
10+
4. In our `.env` add `TENANT_ID, CLIENT_ID, CLIENT_SECRET and RESOURCE`. We can get these values/read more here: https://portal.azure.com/
11+
5. Add the `azure` middleware to your route groups (or wherever) and enjoy :tada:
12+
13+
## Routing
14+
`Route::get('/login/azure', '\RootInc\LaravelAzureMiddleware\Azure@azure');` First parameter can be wherever you want to route the azure login. Change as you would like.
15+
`Route::get('/login/azurecallback', '\RootInc\LaravelAzureMiddleware\Azure@azurecallback');` First parameter can be whatever you want to route after your callback. Change as you would like.
16+
17+
## Front End
18+
19+
It's best to have an Office 365 button on our login webpage that routes to `/login/azure` (or whatever you renamed it to). This can be as simple as an anchor tag like this `<a href="/login/azure" class="officeButton"></a>`
20+
21+
## Contributing
22+
23+
TODO
24+
25+
## License
26+
27+
The Laravel Azure Middleware is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

0 commit comments

Comments
 (0)