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
Update OIDC client documentation with examples and clarifications
Added expanded examples and code snippets for `OidcClient` configuration, logging, automatic mode, and manual mode. Clarified the use of `IBrowser` in authentication flows and highlighted differences between modes, providing links to relevant references and structured explanations.
to invoke a browser on the host desktop platform. The `SystemBrowser` is a naive implementation that uses the
85
+
[System.Diagnostics.Process](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process) class to invoke the browser.
15
86
16
87
```cs
17
88
varoptions=newOidcClientOptions
@@ -26,9 +97,13 @@ var options = new OidcClientOptions
26
97
varclient=newOidcClient(options);
27
98
```
28
99
29
-
Once that is done, authentication and token requests become one line of
30
-
code:
100
+
Once the `IBrowser` is configured, the `LoginAsync` method can be invoked to start the authentication flow.
31
101
32
102
```cs
33
103
varresult=awaitclient.LoginAsync();
34
104
```
105
+
106
+
Setting the `Browser` property reduces the need to process browser respones and to handle the `BrowserResult` directly. When using this automatic mode, the `LoginAsync` method will return a
107
+
[`LoginResult`](https://github.com/DuendeSoftware/foss/blob/19370c6d4820a684d41d1d40b8192ee8b873b8f0/identity-model-oidc-client/src/IdentityModel.OidcClient/LoginResult.cs) which will contain a `ClaimsPrincipal` with the user's claims along with the `IdentityToken` and `AccessToken`.
The result will contain the tokens and the claims of the user.
38
-
47
+
When using this manual mode, and processing the response, the `ProcessResponseAsync` method will return a
48
+
[`LoginResult`](https://github.com/DuendeSoftware/foss/blob/19370c6d4820a684d41d1d40b8192ee8b873b8f0/identity-model-oidc-client/src/IdentityModel.OidcClient/LoginResult.cs) which will contain a `ClaimsPrincipal` with the user's claims along with the `IdentityToken` and `AccessToken`.
0 commit comments