Step-by-Step Process & Entities


1. Developer/Tester (Browser)

2. Swagger UI (Interactive API Documentation)

3. Microsoft Entra ID (Azure AD Tenant)

4. Swagger Client Application

5. ApiService (Backend REST API)

6. IntegrationServiceAPI (Integration REST API)



Step 4: Developer Enters Credentials

What happens:

Who's involved:

What Microsoft validates:

Result:


Step 5: Authorization Code Returned

What happens:

Who's involved:

Result:



Step 6: Exchange Code for Access Token

What happens:

Who's involved:

What's in the access token:

Result:


Step 7: Testing an API Endpoint

What happens (every time developer tests an endpoint):

  1. Developer selects an endpoint (e.g., GET /api/v1/WorkOrder/Overview)
  2. Clicks "Try it out"
  3. Fills in any required parameters
  4. Clicks "Execute"
  5. Swagger UI automatically adds the access token to the request
  6. Request sent to the API

Who's involved:

Result:


Step 8: API Validates Token

What happens (on ApiService/IntegrationServiceAPI):

  1. API receives request with token
  2. Authentication middleware examines the token
  3. Checks who issued the token (Azure AD)
  4. Validates token is authentic:
  5. If all checks pass → Request continues to controller
  6. If any check fails → Return 401 Unauthorized

Who's involved:

What's validated:

Result: