You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/active-directory/develop/authentication-scenarios.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,7 +145,7 @@ This attribute causes ASP.NET to check for the presence of a session cookie cont
145
145
### How a web app delegates sign-in to Azure AD and obtains a token
146
146
147
147
User authentication happens via the browser. The OpenID protocol uses standard HTTP protocol messages.
148
-
- The web app sends an HTTP 202 (redirect) to the browser to use Azure AD.
148
+
- The web app sends an HTTP 203 (redirect) to the browser to use Azure AD.
149
149
- When the user is authenticated, Azure AD sends the token to the web app by using a redirect through the browser.
150
150
- The redirect is provided by the web app in the form of a redirect URI. This redirect URI is registered with the Azure AD application object. There can be several redirect URIs because the application may be deployed at several URLs. So the web app will also need to specify the redirect URi to use.
151
151
- Azure AD verifies that the redirect URI sent by the web app is one of the registered redirect URIs for the app.
@@ -156,7 +156,7 @@ The flow described above applies, with slight differences, to desktop and mobile
156
156
157
157
Desktop and mobile applications can use an embedded Web control, or a system browser, for authentication. The following diagram shows how a Desktop or mobile app uses the Microsoft authentication library (MSAL) to acquire access tokens and call web APIs.
158
158
159
-

159
+

160
160
161
161
MSAL uses a browser to get tokens, and as with web apps, delegates authentication to Azure AD.
In order to prove their identity, confidential client applications exchange a secret with Azure AD. The secret can be:
27
28
- A client secret (application password).
28
29
- A certificate, which is used to build a signed assertion containing standard claims.
@@ -35,6 +36,9 @@ MSAL.NET has four methods to provide either credentials or assertions to the con
35
36
-`.WithClientAssertion()`
36
37
-`.WithClientClaims()`
37
38
39
+
> [!NOTE]
40
+
> While it is possible to use the `WithClientAssertion()` API to acquire tokens for the confidential client, we do not recommend using it by default as it is more advanced and is designed to handle very specific scenarios which are not common. Using the `.WithCertificate()` API will allow MSAL.NET to handle this for you. This api offers you the ability to customize your authentication request if needed but the default assertion created by `.WithCertificate()` will suffice for most authentication scenarios. This API can also be used as a workaround in some scenarios where MSAL.NET fails to perform the signing operation internally.
41
+
38
42
### Signed assertions
39
43
40
44
A signed client assertion takes the form of a signed JWT with the payload containing the required authentication claims mandated by Azure AD, Base64 encoded. To use it:
@@ -63,9 +67,9 @@ Here is an example of how to craft these claims:
You also have the option of using [Microsoft.IdentityModel.JsonWebTokens](https://www.nuget.org/packages/Microsoft.IdentityModel.JsonWebTokens/) to create the assertion for you. The code will be a more elegant as shown in the example below:
`WithClientClaims(X509Certificate2 certificate, IDictionary<string, string> claimsToSign, bool mergeWithDefaultClaims = true)` by default will produce a signed assertion containing the claims expected by Azure AD plus additional client claims that you want to send. Here is a code snippet on how to do that.
0 commit comments