Avalonia.Auth is a flexible and modern authentication library for Avalonia UI applications. It provides reusable UI components and easy integration of OAuth providers such as Google, GitHub, and Hello.
- AuthContext: Customizable authentication context for different providers
- Provider-specific colors & icons
- Easy integration into Avalonia projects
- Extensible for additional OAuth providers
- Sample providers for Google, GitHub, and Hello included
-
Install the NuGet packages:
dotnet add package Avalonia.Auth dotnet add package Avalonia.Auth.BrowserAuth
-
Install Providers
dotnet add package Avalonia.Auth.Github
-
Configure in Program.cs in BuildAvaloniaApp()
.WithAuth(_ => { _.AddProvider<GithubProvider>(); _.UseBrowserAuth(); })
-
Add the AuthContext to your Window:
xmlns:controls="clr-namespace:Avalonia.Auth.Controls;assembly=Avalonia.Auth"
<controls:AuthContext />
All providers that implement AuthProvider
will be automatically displayed, when they are configured.
If no UsernamePasswordProvider is configured the username and password fields are hidden. For Authentication an external Auth provider has to be registered (BrowserAuth or EmbeddedAuth) |
A sample application demonstrating usage can be found in the Sample
folder.
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).
- Helló
- Github
- Discord
[ ] Gitlab
[ ] Microsoft
[ ] Twitch