Download the PHP package joeystowe/ms-graph-api without Composer
On this page you can find all versions of the php package joeystowe/ms-graph-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download joeystowe/ms-graph-api
More information about joeystowe/ms-graph-api
Files in joeystowe/ms-graph-api
Package ms-graph-api
Short Description Laravel MS Graph API
License MIT
Homepage https://github.com/joeystowe/ms-graph-api
Informations about the package ms-graph-api
MS GRAPH API PLUGIN
This adds helper methods to call the MS Graph API and installs a middleware/routes to implement MS Authentication
Installation
You can install the package via composer:
Usage
SSO Authentication
The plugin installs a middleware ('ms-auth') and 2 routes (/auth/callback and /logout). To protect a route with authentication you must apply the middleware to the desired routes and set your env variables
Apply middleware example
Or use middleware groups
[!CAUTION] You can not add the middleware globally or in the web group because the auth callback method needs to be publicy accessible
Set you .env variables
Accessing the user
The ms-auth middleware sets the following scoped session values
You can reference these directly or you can use the LoggedInUser helper class:
Logging Out
Simply hit the '/logout' route to log the user out. After logging out from MS the user will be redirected to a '/postLogout' page. Be sure to set your APP_URL correctly so the "log back in" url will work correctly.
You will also need to publish the assets for the postLogout page to be fully functional:
Calling Graph API
The plugin also gives you helper methods to call the MS graph API
Logged In User Methods
Groups
Changelog
Please see CHANGELOG for more information what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of ms-graph-api with dependencies
laravel/socialite Version ^5.11
socialiteproviders/microsoft-azure Version ^5.1