Samples for using the Auth0 OidcClient with Windows Forms / WPF applications
This repo is supported and maintained by Community Developers, not Auth0. For more information about different support levels check https://auth0.com/docs/support/matrix .
Make sure that App.config
contains your application domain and clientID. Also, don't forget register https://tutorials.auth0.com/mobile
as Allowed Callback URLs.
Hit F5 to start application.
1. Install NuGet
Install-Package Auth0.OidcClient.WPF
2. Instantiate Auth0Client
using Auth0.OidcClient;
var client = new Auth0Client(new Auth0ClientOptions
{
Domain = "{YOUR_AUTH0_DOMAIN}",
ClientId = "{YOUR_CLIENT_ID}"
});
3. Trigger login (with Widget)
var loginResult = await client.LoginAsync();
if (!loginResult.IsError)
{
Debug.WriteLine($"id_token: {loginResult.IdentityToken}");
Debug.WriteLine($"access_token: {loginResult.AccessToken}");
Debug.WriteLine($"name: {loginResult.User.FindFirst(c => c.Type == "name")?.Value}");
Debug.WriteLine($"email: {loginResult.User.FindFirst(c => c.Type == "email")?.Value}");
}
Feel like contributing to this repo? We're glad to hear that! Before you start contributing please visit our Contributing Guideline.
Here you can also find the PR template to fill once creating a PR. It will automatically appear once you open a pull request.
Spotted a bug or any other kind of issue? We're just humans and we're always waiting for constructive feedback! Check our section on how to report issues!
Here you can also find the Issue template to fill once opening a new issue. It will automatically appear once you create an issue.
Feel like PRs and issues are not enough? Want to dive into further discussion about the tool? We created topics for each Auth0 Community repo so that you can join discussion on stack available on our repos. Here it is for this one: auth0-winformswpf-oidc-samples
This project is licensed under the MIT license. See the LICENSE file for more info.
Auth0 helps you to:
- Add authentication with multiple authentication sources, either social like
- Microsoft
- GitHub
- Box
- Salesforce
- etc.
or enterprise identity systems like:
-
Windows Azure AD
-
Google Apps
-
Active Directory
-
ADFS
-
Any SAML Identity Provider
-
Add authentication through more traditional username/password databases
-
Add support for linking different user accounts with the same user
-
Support for generating signed JSON Web Tokens to call your APIs and create user identity flow securely
-
Analytics of how, when and where users are logging in
-
Pull data from other sources and add it to user profile, through JavaScript rules
- Go to Auth0 website
- Hit the SIGN UP button in the upper-right corner