@extends('hms.layout') @section('title','Microsoft staff sign-in') @section('content')
Connect this organisation's Microsoft Entra tenant and link existing staff accounts. Microsoft authenticates the person; HMS keeps control of their roles, facility and employment access.
@if(!$ready)Web redirect URI: {{ $callbackUrl }}
Organisation code: {{ $organization->slug }}
Staff sign-in link: {{ route('microsoft.redirect',['organization'=>$organization->slug]) }}
Changing the tenant requires removing all existing links first. Disabling the connection ends Microsoft access on the next request. Local password login remains available.
In Microsoft Entra admin centre, open Users → select the staff member → copy Object ID. This is not the application/client ID or their email address. Only link an identity after confirming it belongs to the intended staff member in this tenant. Linking does not create a new HMS account or copy Microsoft groups into HMS roles.
@if(!$connection)Save the organisation's tenant ID above before linking accounts.
@else @foreach($members as $member) @php($identity=$identities->get($member->id))Protected administrator account. Platform accounts use local sign-in.
@else @if($identity)@endif @endif