Skip to main content

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

image.png

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

  1. Go to Power Automate.
  2. Click CreateAutomated Cloud Flow.
  3. Name it Sync M365 Users to WAVER.
  4. Choose a trigger: "When a user is added" (Microsoft 365 Users trigger).
  5. Click Create.

2. Configure the Trigger

  1. In the flow editor, the first step is already set: "When a user is added".
  2. Click on it and confirm that it pulls data from M365.

3. Add HTTP Request to Create a new Voucher User

  1. Click New Step → Search HTTP → Select "HTTP".
  2. 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"
      }
      
  3. Click Save.

4. Automate User Deletion

  1. Click New Step.
  2. Search "When a user is deleted" → Select "Microsoft 365 Users - When a user is deleted".
  3. Add a new HTTP Request step.
  4. 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']}"
      }
      
  5. 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.

  1. Click New Step → Select "When a user is updated" (Microsoft 365 Users trigger).
  2. 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']}"
      }
      
  3. Add a Delay step (5 seconds) to ensure the removal is processed.
  4. 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"
      }
      
  5. Click Save.

6. Testing the Flow

  1. Add a new user in Microsoft 365.
  2. Check if the user appears in WAVER (Check Voucher Manager App, or Admin Panel).
  3. Delete the user from Microsoft 365 and confirm they are removed from WAVER's voucher list.
  4. 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.