Example: Microsoft 365 Integration
This guide provides step-by-step instructions to integrate your WAVER Gateway with Microsoft 365 (M365) for Voucher Authentication, allowing users to log in with their Microsoft 365 credentials
Requirements
- Microsoft 365 Admin Account: Required to configure Power Automate and API access.
- Azure AD App Registration: Needed to grant API permissions for user synchronization.
- Power Automate Subscription: A valid Microsoft Power Automate license (included in most Microsoft 365 plans).
- A WAVER Gateway: Must be set up and accessible.
- WAVER API Key: Obtain from WAVER OS under Admin Panel > Integration > API settings.
- API Access Enabled: Ensure POST requests are allowed in WAVER API settings.
- Publicly Accessible WAVER OS API: Ensure your WAVER device can receive API calls from Microsoft’s cloud.
- Firewall Rules Updated: If needed, allow Microsoft Power Automate to communicate with WAVER Cloud URL.
- Microsoft Graph API Permissions:
User.Read.All
(To fetch user details),User.ManageIdentities.All
(To track user changes). - WAVER API Credentials: API Key for authentication, API Endpoint:
https://waver_cloud_url.w-router.com/api
. - A Test Microsoft 365 User: To verify the automation before applying to all users.
1. Create a New Power Automate Flow
- Go to Power Automate.
- Click Create → Automated Cloud Flow.
- Name it Sync M365 Users to WAVER.
- Choose a trigger: "When a user is added" (Microsoft 365 Users trigger).
- Click Create.
2. Configure the Trigger
- In the flow editor, the first step is already set: "When a user is added".
- Click on it and confirm that it pulls data from M365.
3. Add HTTP Request to Create a new Voucher User
- Click New Step → Search HTTP → Select "HTTP".
- Configure it as follows:
- Method:
POST
- URL:
https://waver_cloud_url.w-router.com/api?action=create_voucher&api-key=YOUR_WAVER_API_KEY
- Headers:
Content-Type: application/json
- Body:
{ "username": "@{triggerOutputs()?['body/userPrincipalName']}", "passcode": "DefaultPass123", "fullname": "@{triggerOutputs()?['body/displayName']}", "valid_for": "365 days" }
- Method:
- Click Save.
4. Automate User Deletion
- Click New Step.
- Search "When a user is deleted" → Select "Microsoft 365 Users - When a user is deleted".
- Add a new HTTP Request step.
- Configure it as follows:
- Method:
POST
- URL:
https://waver_cloud_url.w-router.com/api?action=remove_voucher&api-key=YOUR_WAVER_API_KEY
- Headers:
Content-Type: application/json
- Body:
{ "username": "@{triggerOutputs()?['body/userPrincipalName']}" }
- Method:
- Click Save.
5. Automate User Updates
Since WAVER doesn’t support direct user updates, we need to remove and re-add the user when updated.
- Click New Step → Select "When a user is updated" (Microsoft 365 Users trigger).
- Add an HTTP Request step to remove the user:
- Method:
POST
- URL:
https://waver_cloud_url.w-router.com/api?action=remove_voucher&api-key=YOUR_WAVER_API_KEY
- Headers:
Content-Type: application/json
- Body:
{ "username": "@{triggerOutputs()?['body/userPrincipalName']}" }
- Method:
- Add a Delay step (5 seconds) to ensure the removal is processed.
- Add an HTTP Request step to re-add the user:
- Method:
POST
- URL:
https://waver_cloud_url.w-router.com/api?action=create_voucher&api-key=YOUR_WAVER_API_KEY
- Headers:
Content-Type: application/json
- Body:
{ "username": "@{triggerOutputs()?['body/userPrincipalName']}", "passcode": "DefaultPass123", "fullname": "@{triggerOutputs()?['body/displayName']}", "valid_for": "365 days" }
- Method:
- Click Save.
6. Testing the Flow
- Add a new user in Microsoft 365.
- Check if the user appears in WAVER (Check Voucher Manager App, or Admin Panel).
- Delete the user from Microsoft 365 and confirm they are removed from WAVER's voucher list.
- Update the user in Microsoft 365 and check if they are removed and re-added in WAVER voucher list.
7. Deployment & Monitoring
- Enable Flow History Logs in Power Automate to monitor executions.
- Consider adding error handling (e.g., retrying failed API calls).
Now, every time a user is added, removed, or updated in Microsoft 365, WAVER will be automatically updated.