π Microsoft Entra ID
Microsoft Entra ID (formerly Azure Active Directory) is the cloudβbased identity and access management platform used in the homelab to provide centralized authentication, OAuth2 identity services, and secure application access.
In this environment, Entra ID acts as the primary OAuth2 provider for internal applications protected behind the reverse proxy, enabling modern authentication flows without maintaining local identity infrastructure.
Entra ID integrates seamlessly with the homelabβs automation stack, allowing service principals, OAuth2 clients, and application registrations to be provisioned programmatically using Ansible.
π§© How Entra ID Fits Into the Homelab
- Acts as the central identity provider for OAuth2 Proxy
- Provides secure login for internal web applications
- Supports MFA, conditional access, and modern identity governance
- Integrates with Ansible automation for repeatable provisioning
- Eliminates the need for maintaining local OAuth servers
π§± Core Concepts
π§© Service Principal
Think of a Service Principal as the cloudβnative equivalent of a service account β but designed specifically for applications rather than users. Where a service account is a user identity with a password, a Service Principal is an application identity that authenticates using client credentials (secret or certificate) and receives RBACβscoped access to Azure resources. Itβs the secure, modern way for automation tools in the homelab to interact with Entra ID.
Why It Matters Here
- Enables nonβinteractive authentication for automation (Ansible, CI/CD, scripts)
- Provides isolated, leastβprivilege access to Azure resources
- Supports certificateβbased authentication for improved security
- Avoids using user accounts for automation workflows
π RBAC (RoleβBased Access Control)
RBAC is an accessβcontrol model where permissions are assigned to roles, and identities gain permissions only by being assigned those roles.
It simplifies authorization by managing access at the role level instead of the individual level.
Homelab Usage
- Assign minimal roles to Service Principals (e.g., Reader, Contributor)
- Keep automation scoped to only the resources it needs
- Avoid tenantβwide permissions unless absolutely required
π Credential Types
Client Secret
- Simple to generate
- Easy to automate
- Must be rotated regularly
- Stored securely in Ansible Vault or your secretβmanagement workflow
Certificate Authentication
- Stronger security posture
- Longerβlived and harder to exfiltrate
- Ideal for longβrunning automation or CI/CD pipelines
OAuth2 Client Credentials Flow
Used by:
- OAuth2 Proxy
- Internal apps behind the reverse proxy
- Ansible provisioning role
- Any automation that needs tokens from Entra ID
Diagram: App Registration β Service Principal β RBAC
THe following illustrates the relationship between the afformentioned core concepts of Microsoft Entra ID.
ββββββββββββββββββββββββββββ
β Application Object β
β (App Registration) β
β β
β β’ Global definition β
β β’ Client ID β
β β’ Redirect URIs β
β β’ API permissions β
βββββββββββββββ¬βββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββ
β Service Principal β
β (Enterprise App) β
β β
β β’ Instance of the app β
β β’ Auth via secret/cert β
β β’ Identity for automationβ
βββββββββββββββ¬ββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββ
β RBAC β
β Role Assignments β
β β
β β’ Reader / Contributor β
β β’ Leastβprivilege access β
β β’ Scoped to resources β
βββββββββββββββββββββββββββββ
π Related Pages
- Entra ID OAuth2 Provisioning Ansible Role β Automates the creation and configuration of OAuth2 applications, redirect URIs, secrets, and permissions in Entra ID using Ansible.
- Service Principal β Stepβbyβstep instructions for creating a service principal, assigning roles, and preparing credentials for automation tools and OAuth2βprotected services.
- Application Registration - Step-by-step instructions on configuring an Application Registration.
- OAuth2 Proxy Integration with Entra ID β Configuration guide for the homelabβs Nginx frontend server, managing TLS, backend routing, and Entra ID OAuth2 authentication for protected sites.
- Contributor Guide Adding Entra ID OAuth2 Support for a Web Service - Provides a step-by-step instructions on configuring a web service to use Entra ID as an Oauth2 identity provider using Ansible.
β Summary
This page serves as the central hub for all Microsoft Entra IDβrelated documentation in the homelab.
Use the links above to explore automation workflows, service principal creation, and OAuth2 provisioning patterns.