Skip to content

Commit

Permalink
Merge branch 'master' into DOCS-3333
Browse files Browse the repository at this point in the history
  • Loading branch information
kegashe authored Sep 15, 2023
2 parents 6257ce7 + 76c6412 commit f343507
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ topics:
- backend
- webapi-owin
github:
path: Quickstart/01-Authorization
path: Quickstart/Sample
contentType: tutorial
useCase: quickstart
---
Expand Down
2 changes: 1 addition & 1 deletion articles/quickstart/backend/webapi-owin/interactive.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ topics:
- backend
- webapi-owin
github:
path: Quickstart/01-Authorization
path: Quickstart/Sample
contentType: tutorial
useCase: quickstart
interactive: true
Expand Down
15 changes: 1 addition & 14 deletions articles/quickstart/native/wpf-winforms/01-login.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Login
default: true
description: This tutorial demonstrates how to add user login to a Windows Forms C# application using Auth0.
description: This tutorial demonstrates how to add user login to a WPF and Windows Forms C# application using Auth0.
budicon: 448
topics:
- quickstarts
Expand Down Expand Up @@ -41,10 +41,6 @@ To integrate Auth0 login into your application, simply instantiate an instance o

${snippet(meta.snippets.setup)}

::: note
By default, the SDK uses WebView (non-chromium Edge) as a Browser. If you wish to use Chromium Edge, you can implement [WebView2](https://docs.microsoft.com/en-us/microsoft-edge/webview2/) as explained on [this Auth0 Community post](https://community.auth0.com/t/howto-use-the-auth0-oidcclient-winforms-sdk-with-edge-chromium-webview2/57746).
:::

You can then call the `LoginAsync` method to log the user in:

${snippet(meta.snippets.use)}
Expand All @@ -62,8 +58,6 @@ The returned login result will indicate whether authentication was successful, a
You can check the `IsError` property of the result to see whether the login has failed. The `ErrorMessage` will contain more information regarding the error which occurred.

```csharp
// Form1.cs
var loginResult = await client.LoginAsync();

if (loginResult.IsError)
Expand All @@ -77,8 +71,6 @@ if (loginResult.IsError)
On successful login, the login result will contain the ID Token and Access Token in the `IdentityToken` and `AccessToken` properties respectively.

```csharp
// Form1.cs
var loginResult = await client.LoginAsync();

if (!loginResult.IsError)
Expand All @@ -95,8 +87,6 @@ On successful login, the login result will contain the user information in the `
To obtain information about the user, you can query the claims. You can for example obtain the user's name and email address from the `name` and `email` claims:

```csharp
// Form1.cs
if (!loginResult.IsError)
{
Debug.WriteLine($"name: {loginResult.User.FindFirst(c => c.Type == "name")?.Value}");
Expand All @@ -111,8 +101,6 @@ The exact claims returned will depend on the scopes that were requested. For mor
You can obtain a list of all the claims contained in the ID Token by iterating through the `Claims` collection:

```csharp
// Form1.cs
if (!loginResult.IsError)
{
foreach (var claim in loginResult.User.Claims)
Expand All @@ -127,6 +115,5 @@ if (!loginResult.IsError)
To log the user out call the `LogoutAsync` method.

```csharp
// Form1.cs
await client.LogoutAsync();
```
3 changes: 2 additions & 1 deletion articles/quickstart/native/wpf-winforms/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ sdk:
url: https://github.com/auth0/auth0-oidc-client-net
logo: windows
requirements:
- Microsoft Visual Studio 2017
- Microsoft Visual Studio 2022
- .NET Framework 4.6.2
- .NET 6
next_steps:
- path: 01-login
list:
Expand Down
2 changes: 1 addition & 1 deletion articles/quickstart/webapp/aspnet-owin/interactive.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ topics:
- aspnet-owin
- login
github:
path: Quickstart/02-User-Profile
path: Quickstart/Sample
contentType: tutorial
useCase: quickstart
interactive: true
Expand Down

0 comments on commit f343507

Please sign in to comment.