Identity

+
~

The Microsoft Identity platform helps you to build apps that your users can sign in to using their Microsoft identities or social accounts, and provide authorised access to your APIs or Microsoft APIs like Graph.

MS ID offers modern features without implementation headachei:

There are several components involved in the Microsoft Identity platform:

Application objects and service principals

To delegate identity and access management functions to Microsoft Entra, you need to register an application with a Microsoft Entra tenant.

When you register an application with Microsoft Entra, you can decide whether it is:

On creation, an application object and a service principal are created in your "home" tenant. The application object in the home tenant is used as a blueprint to create a service principal in every tenant where this application is used.

The application object describes:

Security principals represent entities that are requesting access to a resource secured by a Microsoft Entra tenant. User principals represent individual users, service principals represent applications. There are three kinds of service principal:

Identity uses a fairly standard OAuth 2.0 scopes design. Requested scopes are included in requests made to the /authorize endpoint.

There are two kinds of permissions:

There are three kinds of consent:

When making an OIDC or OAuth authz request, an app requests scopes via the scope query parameter: a space separated list of requested scopes. Microsoft checks if the user has consented in the past or if an admin has consented on behalf of the user and prompts for consent if neither requirement is met.

GET https://login.microsoftonline.com/common/oauth2/v2.0/authorize?
client_id=00001111-aaaa-2222-bbbb-3333cccc4444
&response_type=code
&redirect_uri=http%3A%2F%2Flocalhost%2Fmyapp%2F
&response_mode=query
&scope=
https%3A%2F%2Fgraph.microsoft.com%2Fcalendars.read%20
https%3A%2F%2Fgraph.microsoft.com%2Fmail.send
&state=12345

Conditional access

Conditional access is a defence-in-depth strategy which allows developers to protect services in a number of ways:

Often, using conditional access doesn't require any developer changes. However, there are some scenarios which may require developers to handle specific challenge from requested resources. Consider the following scenario as an example:

You're building an app that uses a middle tier service to access a downstream API. An enterprise customer at the company using this app applies a policy to the downstream API. When an end user signs in, the app requests access to the middle tier and sends the token. The middle tier performs on-behalf-of flow to request access to the downstream API. At this point, a claims "challenge" is presented to the middle tier. The middle tier sends the challenge back to the app, which needs to comply with the Conditional Access policy.

Specifically, additional development to support conditional access challenges will be required for the following scenarios: