Part 7: Advanced Features and Enterprise Scenarios

Explore advanced MS Entra capabilities including Conditional Access, MFA, Continuous Access Evaluation, Managed Identities, B2B/B2C, custom claims, and enterprise SSO

Introduction

After working with MS Entra for several years across different enterprise environments, I've learned that mastering the basics is just the beginning. The real power comes from understanding advanced features like Conditional Access, Managed Identities, and Continuous Access Evaluation. In this part, I'll share my experiences implementing these advanced capabilities in production systems.

When I transitioned from simple authentication flows to enterprise-grade identity solutions, I discovered features that dramatically improved security posture, reduced operational overhead, and enhanced user experience. Let me show you how to leverage these advanced capabilities.

Prerequisites

Before diving in, you should be familiar with:

  • MS Entra fundamentals (Parts 1-2)

  • Authentication flows (Part 3)

  • Token management (Part 4)

  • API protection (Part 6)

  • Azure services and resources

Conditional Access Policies

Understanding Conditional Access

Conditional Access is MS Entra's policy engine for applying access controls based on signals like user, location, device, application, and risk.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          Access Request                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Evaluate Signals                     β”‚
β”‚   β€’ User/Group                               β”‚
β”‚   β€’ Location (trusted IPs)                   β”‚
β”‚   β€’ Device state (managed/compliant)         β”‚
β”‚   β€’ Application                              β”‚
β”‚   β€’ Sign-in risk                             β”‚
β”‚   β€’ User risk                                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚       Apply Access Controls                  β”‚
β”‚   β€’ Block access                             β”‚
β”‚   β€’ Require MFA                              β”‚
β”‚   β€’ Require compliant device                 β”‚
β”‚   β€’ Require hybrid Azure AD joined device    β”‚
β”‚   β€’ Require app protection policy            β”‚
β”‚   β€’ Require password change                  β”‚
β”‚   β€’ Persist browser session                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Grant or Deny Access                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Handling Conditional Access in Applications

When a Conditional Access policy requires additional action (like MFA), the token request fails with a specific error:

Client-Side Conditional Access Handling

Here's how I handle Conditional Access challenges in a React application:

API Response with Conditional Access Challenge

Here's how to return a claims challenge from your API:

Multi-Factor Authentication (MFA)

Enforcing MFA

Here's how to check MFA status in your application:

MFA Middleware

Continuous Access Evaluation (CAE)

Understanding CAE

Continuous Access Evaluation allows critical security events to revoke access tokens in near real-time, rather than waiting for token expiration.

CAE-Enabled Client Configuration

API Middleware for CAE

Managed Identities

Using Managed Identity in Azure

Managed identities eliminate the need for credentials in your code:

Calling APIs with Managed Identity

Managed Identity in Kubernetes

B2B and B2C Scenarios

Azure AD B2B (Business-to-Business)

B2B allows external users to access your applications:

Handling B2B Users in API

Azure AD B2C Integration

B2C is for customer-facing applications:

Custom Claims and Token Customization

Adding Custom Claims

You can add custom claims using optional claims configuration or claims mapping policy:

Using Extension Attributes

Custom Claims Transform

Enterprise SSO

Configuring Enterprise Application SSO

Home Realm Discovery

Risk-Based Access Control

Handling Identity Protection Signals

Key Takeaways

  1. Conditional Access: Use policy-based access control for dynamic security

  2. MFA Enforcement: Validate authentication methods in your application

  3. CAE Integration: Leverage near real-time token revocation

  4. Managed Identities: Eliminate credentials from your code

  5. B2B/B2C: Support external users and customer scenarios

  6. Custom Claims: Enrich tokens with business-specific data

  7. Enterprise SSO: Enable seamless authentication across applications

  8. Risk Detection: Implement adaptive authentication based on risk signals

  9. Home Realm Discovery: Optimize federated authentication flows

  10. Claims Transformation: Adapt token claims to your application needs

Common Patterns

Pattern 1: Progressive Security

Pattern 2: Tenant-Aware Operations

Next Steps

In Part 8: Production Best Practices, we'll cover:

  • Security hardening and threat mitigation

  • Monitoring and logging strategies

  • Performance optimization

  • Troubleshooting common issues

  • Disaster recovery

  • Compliance and auditing

Additional Resources


This is part 7 of the MS Entra 101 Series. Continue to Part 8: Production Best Practices for production deployment guidance.

Last updated