├── .editorconfig
├── .gitattributes
├── .github
├── stale.yml
└── workflows
│ └── dotnetcore.yml
├── .gitignore
├── Firebase.Auth.sln
├── LICENSE.txt
├── README.md
├── art
├── FirebaseLogo.128x128.png
└── SampleWPF.png
├── build
├── build-libs.ps1
├── build-samples.ps1
├── download-localizations.ps1
├── run-pack.ps1
└── run-tests.ps1
├── samples
├── Console
│ ├── Auth.Console.Sample.csproj
│ └── Program.cs
├── UWP
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Assets
│ │ ├── SplashScreen.scale-200.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square44x44Logo.png
│ │ ├── Square44x44Logo.scale-400.png
│ │ ├── StoreLogo.png
│ │ ├── StoreLogo.scale-400.png
│ │ └── firebase.png
│ ├── Auth.UWP.Sample.csproj
│ ├── LoginPage.xaml
│ ├── LoginPage.xaml.cs
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── Package.appxmanifest
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── Default.rd.xml
│ └── strings
│ │ ├── ar
│ │ └── Resources.resw
│ │ ├── bg
│ │ └── Resources.resw
│ │ ├── ca
│ │ └── Resources.resw
│ │ ├── cs
│ │ └── Resources.resw
│ │ ├── da
│ │ └── Resources.resw
│ │ ├── de
│ │ └── Resources.resw
│ │ ├── el
│ │ └── Resources.resw
│ │ ├── en
│ │ └── Resources.resw
│ │ ├── es
│ │ └── Resources.resw
│ │ ├── fa
│ │ └── Resources.resw
│ │ ├── fi
│ │ └── Resources.resw
│ │ ├── fil
│ │ └── Resources.resw
│ │ ├── fr
│ │ └── Resources.resw
│ │ ├── hi
│ │ └── Resources.resw
│ │ ├── hr
│ │ └── Resources.resw
│ │ ├── hu
│ │ └── Resources.resw
│ │ ├── in
│ │ └── Resources.resw
│ │ ├── it
│ │ └── Resources.resw
│ │ ├── iw
│ │ └── Resources.resw
│ │ ├── ja
│ │ └── Resources.resw
│ │ ├── ko
│ │ └── Resources.resw
│ │ ├── lt
│ │ └── Resources.resw
│ │ ├── lv
│ │ └── Resources.resw
│ │ ├── nl
│ │ └── Resources.resw
│ │ ├── no
│ │ └── Resources.resw
│ │ ├── pl
│ │ └── Resources.resw
│ │ ├── pt
│ │ └── Resources.resw
│ │ ├── ro
│ │ └── Resources.resw
│ │ ├── ru
│ │ └── Resources.resw
│ │ ├── sk
│ │ └── Resources.resw
│ │ ├── sl
│ │ └── Resources.resw
│ │ ├── sr-cyrl
│ │ └── Resources.resw
│ │ ├── sv
│ │ └── Resources.resw
│ │ ├── th
│ │ └── Resources.resw
│ │ ├── tr
│ │ └── Resources.resw
│ │ ├── uk
│ │ └── Resources.resw
│ │ ├── ur
│ │ └── Resources.resw
│ │ ├── vi
│ │ └── Resources.resw
│ │ └── zh
│ │ └── Resources.resw
├── WinUI3
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Assets
│ │ ├── SplashScreen.scale-200.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square44x44Logo.png
│ │ ├── Square44x44Logo.scale-400.png
│ │ ├── StoreLogo.png
│ │ ├── StoreLogo.scale-400.png
│ │ └── firebase.png
│ ├── Auth.WinUI3.Sample.csproj
│ ├── LoginPage.xaml
│ ├── LoginPage.xaml.cs
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── Package.appxmanifest
│ ├── Properties
│ │ ├── Default.rd.xml
│ │ └── launchSettings.json
│ ├── UWPToWinAppSDKUpgradeHelpers.cs
│ ├── app.manifest
│ └── strings
│ │ ├── ar
│ │ └── Resources.resw
│ │ ├── bg
│ │ └── Resources.resw
│ │ ├── ca
│ │ └── Resources.resw
│ │ ├── cs
│ │ └── Resources.resw
│ │ ├── da
│ │ └── Resources.resw
│ │ ├── de
│ │ └── Resources.resw
│ │ ├── el
│ │ └── Resources.resw
│ │ ├── en
│ │ └── Resources.resw
│ │ ├── es
│ │ └── Resources.resw
│ │ ├── fa
│ │ └── Resources.resw
│ │ ├── fi
│ │ └── Resources.resw
│ │ ├── fil
│ │ └── Resources.resw
│ │ ├── fr
│ │ └── Resources.resw
│ │ ├── hi
│ │ └── Resources.resw
│ │ ├── hr
│ │ └── Resources.resw
│ │ ├── hu
│ │ └── Resources.resw
│ │ ├── in
│ │ └── Resources.resw
│ │ ├── it
│ │ └── Resources.resw
│ │ ├── iw
│ │ └── Resources.resw
│ │ ├── ja
│ │ └── Resources.resw
│ │ ├── ko
│ │ └── Resources.resw
│ │ ├── lt
│ │ └── Resources.resw
│ │ ├── lv
│ │ └── Resources.resw
│ │ ├── nl
│ │ └── Resources.resw
│ │ ├── no
│ │ └── Resources.resw
│ │ ├── pl
│ │ └── Resources.resw
│ │ ├── pt
│ │ └── Resources.resw
│ │ ├── ro
│ │ └── Resources.resw
│ │ ├── ru
│ │ └── Resources.resw
│ │ ├── sk
│ │ └── Resources.resw
│ │ ├── sl
│ │ └── Resources.resw
│ │ ├── sr-cyrl
│ │ └── Resources.resw
│ │ ├── sv
│ │ └── Resources.resw
│ │ ├── th
│ │ └── Resources.resw
│ │ ├── tr
│ │ └── Resources.resw
│ │ ├── uk
│ │ └── Resources.resw
│ │ ├── ur
│ │ └── Resources.resw
│ │ ├── vi
│ │ └── Resources.resw
│ │ └── zh
│ │ └── Resources.resw
└── Wpf
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AssemblyInfo.cs
│ ├── Assets
│ ├── firebase.ico
│ └── firebase.png
│ ├── Auth.Wpf.Sample.csproj
│ ├── LoginPage.xaml
│ ├── LoginPage.xaml.cs
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── MainWindow.xaml
│ └── MainWindow.xaml.cs
├── src
├── Auth.UI.UWP
│ ├── Auth.UI.UWP.csproj
│ ├── Converters
│ │ ├── AssetConverter.cs
│ │ ├── BackgroundConverter.cs
│ │ ├── BorderThicknessConverter.cs
│ │ ├── ForegroundConverter.cs
│ │ └── TitleConverter.cs
│ ├── FirebaseUIControl.cs
│ ├── Pages
│ │ ├── EmailPage.xaml
│ │ ├── EmailPage.xaml.cs
│ │ ├── LinksFooter.xaml
│ │ ├── LinksFooter.xaml.cs
│ │ ├── ProvidersPage.xaml
│ │ ├── ProvidersPage.xaml.cs
│ │ ├── RecoverPasswordPage.xaml
│ │ ├── RecoverPasswordPage.xaml.cs
│ │ ├── SignInPage.xaml
│ │ ├── SignInPage.xaml.cs
│ │ ├── SignUpPage.xaml
│ │ ├── SignUpPage.xaml.cs
│ │ └── Styles.cs
│ ├── Properties
│ │ └── Auth.UI.UWP.rd.xml
│ ├── Repository
│ │ └── StorageRepository.cs
│ ├── Themes
│ │ ├── FirebaseUIControl.xaml
│ │ └── Generic.xaml
│ └── tools
│ │ └── VisualStudioToolsManifest.xml
├── Auth.UI.WPF
│ ├── Auth.UI.WPF.csproj
│ ├── Converters
│ │ ├── AssetConverter.cs
│ │ ├── BackgroundConverter.cs
│ │ ├── ForegroundConverter.cs
│ │ └── TitleConverter.cs
│ ├── FirebaseUIControl.xaml
│ ├── FirebaseUIControl.xaml.cs
│ ├── Launcher.cs
│ ├── Pages
│ │ ├── EmailPage.xaml
│ │ ├── EmailPage.xaml.cs
│ │ ├── LinksFooter.xaml
│ │ ├── LinksFooter.xaml.cs
│ │ ├── ProvidersPage.xaml
│ │ ├── ProvidersPage.xaml.cs
│ │ ├── RecoverPasswordPage.xaml
│ │ ├── RecoverPasswordPage.xaml.cs
│ │ ├── SignInPage.xaml
│ │ ├── SignInPage.xaml.cs
│ │ ├── SignUpPage.xaml
│ │ └── SignUpPage.xaml.cs
│ ├── Themes
│ │ └── Generic.xaml
│ ├── WebAuthenticationBroker.cs
│ ├── WebAuthenticationBrokerWindow.xaml
│ ├── WebAuthenticationBrokerWindow.xaml.cs
│ └── tools
│ │ └── VisualStudioToolsManifest.xml
├── Auth.UI.WinUI3
│ ├── Auth.UI.WinUI3.csproj
│ ├── Converters
│ │ ├── AssetConverter.cs
│ │ ├── BackgroundConverter.cs
│ │ ├── BorderThicknessConverter.cs
│ │ ├── ForegroundConverter.cs
│ │ └── TitleConverter.cs
│ ├── FirebaseUIControl.cs
│ ├── Pages
│ │ ├── EmailPage.xaml
│ │ ├── EmailPage.xaml.cs
│ │ ├── LinksFooter.xaml
│ │ ├── LinksFooter.xaml.cs
│ │ ├── ProvidersPage.xaml
│ │ ├── ProvidersPage.xaml.cs
│ │ ├── RecoverPasswordPage.xaml
│ │ ├── RecoverPasswordPage.xaml.cs
│ │ ├── SignInPage.xaml
│ │ ├── SignInPage.xaml.cs
│ │ ├── SignUpPage.xaml
│ │ ├── SignUpPage.xaml.cs
│ │ └── Styles.cs
│ ├── Repository
│ │ └── StorageRepository.cs
│ ├── Themes
│ │ ├── FirebaseUIControl.xaml
│ │ └── Generic.xaml
│ ├── WebAuthenticationBroker.cs
│ ├── WebAuthenticationBrokerWindow.xaml
│ ├── WebAuthenticationBrokerWindow.xaml.cs
│ └── tools
│ │ └── VisualStudioToolsManifest.xml
├── Auth.UI
│ ├── Assets
│ │ ├── anonymous.png
│ │ ├── apple.png
│ │ ├── facebook.png
│ │ ├── firebase.png
│ │ ├── github.png
│ │ ├── google.png
│ │ ├── mail.png
│ │ ├── microsoft.png
│ │ └── twitter.png
│ ├── Auth.UI.csproj
│ ├── Converters
│ │ ├── ProviderToAssetConverter.cs
│ │ ├── ProviderToBackgroundConverter.cs
│ │ ├── ProviderToForegroundConverter.cs
│ │ └── ProviderToTitleConverter.cs
│ ├── EmailPasswordResult.cs
│ ├── EmailUser.cs
│ ├── EmailValidator.cs
│ ├── FirebaseErrorLookup.cs
│ ├── FirebaseUI.cs
│ ├── FirebaseUIConfig.cs
│ ├── FirebaseUpgradeConflict.cs
│ ├── IFirebaseUIFlow.cs
│ └── Resources
│ │ ├── AppResources.Designer.cs
│ │ ├── AppResources.ar.resx
│ │ ├── AppResources.bg.resx
│ │ ├── AppResources.ca.resx
│ │ ├── AppResources.cs.resx
│ │ ├── AppResources.da.resx
│ │ ├── AppResources.de.resx
│ │ ├── AppResources.el.resx
│ │ ├── AppResources.es.resx
│ │ ├── AppResources.fa.resx
│ │ ├── AppResources.fi.resx
│ │ ├── AppResources.fil.resx
│ │ ├── AppResources.fr.resx
│ │ ├── AppResources.hi.resx
│ │ ├── AppResources.hr.resx
│ │ ├── AppResources.hu.resx
│ │ ├── AppResources.in.resx
│ │ ├── AppResources.it.resx
│ │ ├── AppResources.iw.resx
│ │ ├── AppResources.ja.resx
│ │ ├── AppResources.ko.resx
│ │ ├── AppResources.lt.resx
│ │ ├── AppResources.lv.resx
│ │ ├── AppResources.nl.resx
│ │ ├── AppResources.no.resx
│ │ ├── AppResources.pl.resx
│ │ ├── AppResources.pt.resx
│ │ ├── AppResources.resx
│ │ ├── AppResources.ro.resx
│ │ ├── AppResources.ru.resx
│ │ ├── AppResources.sk.resx
│ │ ├── AppResources.sl.resx
│ │ ├── AppResources.sr-cyrl.resx
│ │ ├── AppResources.sv.resx
│ │ ├── AppResources.th.resx
│ │ ├── AppResources.tr.resx
│ │ ├── AppResources.uk.resx
│ │ ├── AppResources.ur.resx
│ │ ├── AppResources.vi.resx
│ │ └── AppResources.zh.resx
└── Auth
│ ├── Assets
│ └── firebase.png
│ ├── Auth.csproj
│ ├── AuthCredential.cs
│ ├── AuthErrorReason.cs
│ ├── EnumExtensions.cs
│ ├── FirebaseAuthClient.cs
│ ├── FirebaseAuthConfig.cs
│ ├── FirebaseAuthException.cs
│ ├── FirebaseCredential.cs
│ ├── FirebaseFailureParser.cs
│ ├── FirebaseProviderType.cs
│ ├── IFirebaseAuthClient.cs
│ ├── Providers
│ ├── AppleProvider.cs
│ ├── EmailProvider.cs
│ ├── FacebookProvider.cs
│ ├── FetchUserProvidersResult.cs
│ ├── FirebaseAuthProvider.cs
│ ├── GithubProvider.cs
│ ├── GoogleProvider.cs
│ ├── MicrosoftProvider.cs
│ ├── OAuthContinuation.cs
│ ├── OAuthProvider.cs
│ └── TwitterProvider.cs
│ ├── Repository
│ ├── FileUserRepository.cs
│ ├── IUserRepository.cs
│ └── InMemoryRepository.cs
│ ├── Requests
│ ├── Converters
│ │ ├── DefaultEnumConverter.cs
│ │ └── JavaScriptDateTimeConverter.cs
│ ├── CreateAuthUri.cs
│ ├── DeleteAccount.cs
│ ├── Endpoints.cs
│ ├── FirebaseRequestBase.cs
│ ├── GetAccountInfo.cs
│ ├── ProjectConfig.cs
│ ├── RefreshToken.cs
│ ├── ResetPassword.cs
│ ├── SetAccountInfo.cs
│ ├── SetAccountLink.cs
│ ├── SetAccountUnlink.cs
│ ├── SignupNewUser.cs
│ ├── UpdateAccount.cs
│ ├── VerifyAssertion.cs
│ └── VerifyPassword.cs
│ ├── Settings.StyleCop
│ ├── SignInRedirectDelegate.cs
│ ├── User.cs
│ ├── UserCredential.cs
│ ├── UserEventArgs.cs
│ ├── UserInfo.cs
│ └── UserManager.cs
└── tests
├── Auth.Tests.Integration
├── AnonymousTests.cs
├── Auth.Tests.Integration.csproj
├── EmailTests.cs
└── Setup.cs
└── Auth.Tests
├── Auth.Tests.csproj
├── ClientTests.cs
├── ErrorParserTests.cs
└── RepositoryTests.cs
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 |
3 | # CS1591: Missing XML comment for publicly visible type or member
4 | dotnet_diagnostic.CS1591.severity = silent
5 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Number of days of inactivity before an issue becomes stale
2 | daysUntilStale: 180
3 | # Number of days of inactivity before a stale issue is closed
4 | daysUntilClose: 7
5 | # Issues with these labels will never be considered stale
6 | exemptLabels:
7 | - pinned
8 | - security
9 | - enhancement
10 | - up-for-grabs
11 | # Label to use when marking an issue as stale
12 | staleLabel: stale
13 | # Comment to post when marking an issue as stale. Set to `false` to disable
14 | markComment: >
15 | This issue has been automatically marked as stale because it has not had
16 | recent activity. It will be closed if no further activity occurs. Thank you
17 | for your contributions.
18 | # Comment to post when closing a stale issue. Set to `false` to disable
19 | closeComment: Closing the issue due to inactivity. Feel free to re-open
20 |
--------------------------------------------------------------------------------
/.github/workflows/dotnetcore.yml:
--------------------------------------------------------------------------------
1 | name: build
2 |
3 | on:
4 | push:
5 | branches: '**'
6 | tags: 'v*.*.*'
7 | pull_request:
8 |
9 | jobs:
10 | build:
11 | runs-on: windows-latest
12 | steps:
13 | - uses: actions/checkout@v3
14 | - name: Setup .NET
15 | uses: actions/setup-dotnet@v3
16 | with:
17 | dotnet-version: 6
18 | - name: Setup MSBuild
19 | uses: microsoft/setup-msbuild@v1.1
20 | - name: Build
21 | run: .\build\build-libs.ps1
22 | env:
23 | DOTNET_CLI_TELEMETRY_OPTOUT: 1
24 | - name: Run Tests
25 | env:
26 | FIREBASE_AUTH_TEST_API_KEY: ${{ secrets.FIREBASE_AUTH_TEST_API_KEY }}
27 | FIREBASE_AUTH_TEST_DOMAIN: ${{ secrets.FIREBASE_AUTH_TEST_DOMAIN }}
28 | run: .\build\run-tests.ps1
29 | pack:
30 | runs-on: windows-latest
31 | needs: build
32 | if: github.event_name == 'push'
33 | steps:
34 | - uses: actions/checkout@v3
35 | - name: Setup .NET
36 | uses: actions/setup-dotnet@v3
37 | with:
38 | dotnet-version: 6
39 | - name: Setup MSBuild
40 | uses: microsoft/setup-msbuild@v1.1
41 | - name: Pack preview
42 | if: startsWith(github.ref, 'refs/tags/') == false
43 | run: .\build\run-pack.ps1 -preview
44 | env:
45 | DOTNET_CLI_TELEMETRY_OPTOUT: 1
46 | - name: Pack from tag
47 | if: startsWith(github.ref, 'refs/tags/')
48 | run: .\build\run-pack.ps1
49 | env:
50 | DOTNET_CLI_TELEMETRY_OPTOUT: 1
51 | - uses: actions/upload-artifact@v3
52 | with:
53 | name: artifacts
54 | path: ./artifacts
55 | publish:
56 | runs-on: ubuntu-latest
57 | needs: pack
58 | if: github.event_name == 'push'
59 | steps:
60 | - name: Setup .NET
61 | uses: actions/setup-dotnet@v3
62 | with:
63 | dotnet-version: 6
64 | - uses: actions/download-artifact@v3
65 | with:
66 | name: artifacts
67 | path: ./artifacts
68 | - name: Publish to Feedz.io
69 | if: startsWith(github.ref, 'refs/tags/') == false
70 | run: dotnet nuget push ./artifacts/**/*.nupkg --source https://f.feedz.io/step-up-labs/firebase/nuget/index.json --api-key ${{secrets.FEEDZ_TOKEN}}
71 | - name: Publish to Nuget.org
72 | if: startsWith(github.ref, 'refs/tags/')
73 | run: dotnet nuget push ./artifacts/**/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_TOKEN}}
74 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2019 Step Up Labs
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/art/FirebaseLogo.128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/art/FirebaseLogo.128x128.png
--------------------------------------------------------------------------------
/art/SampleWPF.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/art/SampleWPF.png
--------------------------------------------------------------------------------
/build/build-libs.ps1:
--------------------------------------------------------------------------------
1 | dotnet build --configuration release .\src\Auth\Auth.csproj
2 | dotnet build --configuration release .\src\Auth.UI\Auth.UI.csproj
3 | dotnet build --configuration release .\src\Auth.UI.WPF\Auth.UI.WPF.csproj
4 | dotnet build --configuration release .\src\Auth.UI.WinUI3\Auth.UI.WinUI3.csproj
5 | msbuild /restore /p:Configuration=Release .\src\Auth.UI.UWP\Auth.UI.UWP.csproj
--------------------------------------------------------------------------------
/build/build-samples.ps1:
--------------------------------------------------------------------------------
1 | dotnet build --configuration release .\samples\Console\Auth.Console.Sample.csproj
2 | dotnet build --configuration release .\samples\WPF\Auth.WPF.Sample.csproj
3 | dotnet build --configuration release .\samples\WinUI3\Auth.WinUI3.Sample.csproj
4 | msbuild /restore /p:Configuration=Debug .\samples\UWP\Auth.UWP.Sample.csproj
--------------------------------------------------------------------------------
/build/run-pack.ps1:
--------------------------------------------------------------------------------
1 | param([switch] $preview)
2 |
3 | $output = Join-Path $pwd "artifacts"
4 |
5 | if ($preview) {
6 | $suffix = "preview-$(Get-Date -format yyyyMMddHHmmss)"
7 | write "Creating preview packages with version suffix $suffix"
8 | dotnet pack --configuration release --output $output --version-suffix=$suffix .\src\Auth\Auth.csproj
9 | dotnet pack --configuration release --output $output --version-suffix=$suffix .\src\Auth.UI.WPF\Auth.UI.WPF.csproj
10 | dotnet pack --configuration release --output $output --version-suffix=$suffix .\src\Auth.UI.WinUI3\Auth.UI.WinUI3.csproj
11 | msbuild /t:restore,pack /p:Configuration=Release /p:PackageOutputPath=$output /p:VersionSuffix=$suffix .\src\Auth.UI.UWP\Auth.UI.UWP.csproj
12 | } else {
13 | $version = $(git describe --tags --abbrev=0).substring(1)
14 | write "Creating packages with tag version $version"
15 | dotnet pack --configuration release --output $output -p:version=$version .\src\Auth\Auth.csproj
16 | dotnet pack --configuration release --output $output -p:version=$version .\src\Auth.UI.WPF\Auth.UI.WPF.csproj
17 | dotnet pack --configuration release --output $output -p:version=$version .\src\Auth.UI.WinUI3\Auth.UI.WinUI3.csproj
18 | msbuild /t:restore,pack /p:Configuration=Release /p:PackageOutputPath=$output /p:Version=$version .\src\Auth.UI.UWP\Auth.UI.UWP.csproj
19 | }
--------------------------------------------------------------------------------
/build/run-tests.ps1:
--------------------------------------------------------------------------------
1 | dotnet test --configuration Release .\tests\Auth.Tests\
2 | dotnet test --configuration Release .\tests\Auth.Tests.Integration\
--------------------------------------------------------------------------------
/samples/Console/Auth.Console.Sample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/samples/UWP/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/samples/UWP/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/UWP/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/samples/UWP/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/UWP/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/samples/UWP/Assets/Square44x44Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/UWP/Assets/Square44x44Logo.png
--------------------------------------------------------------------------------
/samples/UWP/Assets/Square44x44Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/UWP/Assets/Square44x44Logo.scale-400.png
--------------------------------------------------------------------------------
/samples/UWP/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/UWP/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/samples/UWP/Assets/StoreLogo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/UWP/Assets/StoreLogo.scale-400.png
--------------------------------------------------------------------------------
/samples/UWP/Assets/firebase.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/UWP/Assets/firebase.png
--------------------------------------------------------------------------------
/samples/UWP/LoginPage.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/samples/UWP/LoginPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml.Controls;
2 |
3 | namespace Auth.UWP.Sample
4 | {
5 | public sealed partial class LoginPage : Page
6 | {
7 | public LoginPage()
8 | {
9 | this.InitializeComponent();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/samples/UWP/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
22 |
23 |
26 |
29 |
32 |
35 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/samples/UWP/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Firebase.Auth;
2 | using Firebase.Auth.UI;
3 | using System;
4 | using System.Numerics;
5 | using Windows.UI.Core;
6 | using Windows.UI.Xaml;
7 | using Windows.UI.Xaml.Controls;
8 | using Windows.UI.Xaml.Media.Imaging;
9 |
10 | namespace Auth.UWP.Sample
11 | {
12 | public sealed partial class MainPage : Page
13 | {
14 | public MainPage()
15 | {
16 | this.InitializeComponent();
17 |
18 | FirebaseUI.Instance.Client.AuthStateChanged += this.AuthStateChanged;
19 | }
20 |
21 | private async void AuthStateChanged(object sender, UserEventArgs e)
22 | {
23 | var user = e.User;
24 |
25 | if (user?.IsAnonymous ?? true)
26 | {
27 | return;
28 | }
29 |
30 | await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
31 | CoreDispatcherPriority.Normal,
32 | () =>
33 | {
34 | this.UidTextBlock.Text = user.Uid ?? "";
35 | this.NameTextBlock.Text = user.Info.DisplayName ?? "";
36 | this.EmailTextBlock.Text = user.Info.Email ?? "";
37 | this.ProviderTextBlock.Text = user.Credential.ProviderType.ToString();
38 |
39 | if (!string.IsNullOrWhiteSpace(user.Info.PhotoUrl))
40 | {
41 | this.ProfileImage.Source = new BitmapImage(new Uri(user.Info.PhotoUrl));
42 | }
43 | });
44 | }
45 |
46 | private void SignOutClick(object sender, RoutedEventArgs e)
47 | {
48 | FirebaseUI.Instance.Client.SignOut();
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/samples/UWP/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 |
16 |
17 | Auth.UWP.Sample
18 | bezysoftware
19 | Assets\StoreLogo.png
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/samples/UWP/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Auth.UWP.Sample")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Auth.UWP.Sample")]
13 | [assembly: AssemblyCopyright("Copyright © 2020")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/samples/UWP/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/samples/WinUI3/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/samples/WinUI3/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/WinUI3/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/samples/WinUI3/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/WinUI3/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/samples/WinUI3/Assets/Square44x44Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/WinUI3/Assets/Square44x44Logo.png
--------------------------------------------------------------------------------
/samples/WinUI3/Assets/Square44x44Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/WinUI3/Assets/Square44x44Logo.scale-400.png
--------------------------------------------------------------------------------
/samples/WinUI3/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/WinUI3/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/samples/WinUI3/Assets/StoreLogo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/WinUI3/Assets/StoreLogo.scale-400.png
--------------------------------------------------------------------------------
/samples/WinUI3/Assets/firebase.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/WinUI3/Assets/firebase.png
--------------------------------------------------------------------------------
/samples/WinUI3/LoginPage.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/samples/WinUI3/LoginPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml.Controls;
2 |
3 | namespace Auth.WinUI3.Sample
4 | {
5 | public sealed partial class LoginPage : Page
6 | {
7 | public LoginPage()
8 | {
9 | this.InitializeComponent();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/samples/WinUI3/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
22 |
23 |
26 |
29 |
32 |
35 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/samples/WinUI3/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Firebase.Auth;
2 | using Firebase.Auth.UI;
3 | using Microsoft.UI.Xaml;
4 | using Microsoft.UI.Xaml.Controls;
5 | using Microsoft.UI.Xaml.Media.Imaging;
6 | using System;
7 |
8 | namespace Auth.WinUI3.Sample
9 | {
10 | public sealed partial class MainPage : Page
11 | {
12 | public MainPage()
13 | {
14 | this.InitializeComponent();
15 |
16 | FirebaseUI.Instance.Client.AuthStateChanged += this.AuthStateChanged;
17 | }
18 |
19 | private void AuthStateChanged(object sender, UserEventArgs e)
20 | {
21 | var user = e.User;
22 |
23 | if (user?.IsAnonymous ?? true)
24 | {
25 | return;
26 | }
27 |
28 | DispatcherQueue.TryEnqueue(() =>
29 | {
30 | this.UidTextBlock.Text = user.Uid ?? "";
31 | this.NameTextBlock.Text = user.Info.DisplayName ?? "";
32 | this.EmailTextBlock.Text = user.Info.Email ?? "";
33 | this.ProviderTextBlock.Text = user.Credential.ProviderType.ToString();
34 |
35 | if (!string.IsNullOrWhiteSpace(user.Info.PhotoUrl))
36 | {
37 | this.ProfileImage.Source = new BitmapImage(new Uri(user.Info.PhotoUrl));
38 | }
39 | });
40 | }
41 |
42 | private void SignOutClick(object sender, RoutedEventArgs e)
43 | {
44 | FirebaseUI.Instance.Client.SignOut();
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/samples/WinUI3/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
29 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/samples/WinUI3/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
15 |
16 |
17 |
18 |
19 | Auth.WinUI3.Sample
20 | bezysoftware
21 | Assets\StoreLogo.png
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
38 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/samples/WinUI3/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/samples/WinUI3/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Auth.WinUI3.Sample (Package)": {
4 | "commandName": "MsixPackage"
5 | },
6 | "Auth.WinUI3.Sample (Unpackaged)": {
7 | "commandName": "Project"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/samples/WinUI3/UWPToWinAppSDKUpgradeHelpers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace UWPToWinAppSDKUpgradeHelpers
4 | {
5 | [System.Runtime.InteropServices.ComImport]
6 | [System.Runtime.InteropServices.Guid("3A3DCD6C-3EAB-43DC-BCDE-45671CE800C8")]
7 | [System.Runtime.InteropServices.InterfaceType(
8 | System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
9 | interface IDataTransferManagerInterop
10 | {
11 | IntPtr GetForWindow([System.Runtime.InteropServices.In] IntPtr appWindow,
12 | [System.Runtime.InteropServices.In] ref Guid riid);
13 | void ShowShareUIForWindow(IntPtr appWindow);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/samples/WinUI3/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 | true/PM
12 | PerMonitorV2, PerMonitor
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/samples/Wpf/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/samples/Wpf/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Firebase.Auth.Providers;
2 | using Firebase.Auth.Repository;
3 | using Firebase.Auth.UI;
4 | using System.Globalization;
5 | using System.Windows;
6 |
7 | namespace Firebase.Auth.Wpf.Sample
8 | {
9 | public partial class App : Application
10 | {
11 | public App()
12 | {
13 | // Force override culture & language
14 | //CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("cs");
15 | //CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("cs");
16 |
17 | // Firebase UI initialization
18 | FirebaseUI.Initialize(new FirebaseUIConfig
19 | {
20 | ApiKey = "",
21 | AuthDomain = ".firebaseapp.com",
22 | Providers = new FirebaseAuthProvider[]
23 | {
24 | new GoogleProvider(),
25 | new FacebookProvider(),
26 | new AppleProvider(),
27 | new TwitterProvider(),
28 | new GithubProvider(),
29 | new MicrosoftProvider(),
30 | new EmailProvider()
31 | },
32 | PrivacyPolicyUrl = "https://github.com/step-up-labs/firebase-authentication-dotnet",
33 | TermsOfServiceUrl = "https://github.com/step-up-labs/firebase-database-dotnet",
34 | IsAnonymousAllowed = true,
35 | AutoUpgradeAnonymousUsers = true,
36 | UserRepository = new FileUserRepository("FirebaseSample"),
37 | // Func called when upgrade of anonymous user fails because the user already exists
38 | // You should grab any data created under your anonymous user, sign in with the pending credential
39 | // and copy the existing data to the new user
40 | // see details here: https://github.com/firebase/firebaseui-web#upgrading-anonymous-users
41 | AnonymousUpgradeConflict = conflict => conflict.SignInWithPendingCredentialAsync(true)
42 | });
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/samples/Wpf/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/samples/Wpf/Assets/firebase.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/Wpf/Assets/firebase.ico
--------------------------------------------------------------------------------
/samples/Wpf/Assets/firebase.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/step-up-labs/firebase-authentication-dotnet/72514a251b522da50e6a22f02c70b6e9a623be8c/samples/Wpf/Assets/firebase.png
--------------------------------------------------------------------------------
/samples/Wpf/Auth.Wpf.Sample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6-windows
6 | true
7 | Firebase.Auth.Wpf.Sample
8 | Firebase.Auth.Wpf.Sample
9 | Assets\firebase.ico
10 | false
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/samples/Wpf/LoginPage.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
20 |
21 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/samples/Wpf/LoginPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace Firebase.Auth.Wpf.Sample
4 | {
5 | public partial class LoginPage : Page
6 | {
7 | public LoginPage()
8 | {
9 | InitializeComponent();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/samples/Wpf/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
16 |
17 |
18 |
23 |
24 |
27 |
30 |
33 |
36 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/samples/Wpf/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Firebase.Auth.UI;
2 | using System;
3 | using System.Windows;
4 | using System.Windows.Controls;
5 | using System.Windows.Media.Imaging;
6 |
7 | namespace Firebase.Auth.Wpf.Sample
8 | {
9 | public partial class MainPage : Page
10 | {
11 | public MainPage()
12 | {
13 | InitializeComponent();
14 |
15 | FirebaseUI.Instance.Client.AuthStateChanged += this.AuthStateChanged;
16 | }
17 |
18 | private void AuthStateChanged(object sender, UserEventArgs e)
19 | {
20 | var user = e.User;
21 |
22 | Application.Current.Dispatcher.Invoke(() =>
23 | {
24 | this.UidTextBlock.Text = user.Uid;
25 | this.NameTextBlock.Text = user.Info.DisplayName;
26 | this.EmailTextBlock.Text = user.Info.Email;
27 | this.ProviderTextBlock.Text = user.Credential.ProviderType.ToString();
28 |
29 | if (!string.IsNullOrWhiteSpace(user.Info.PhotoUrl))
30 | {
31 | this.ProfileImage.Source = new BitmapImage(new Uri(user.Info.PhotoUrl));
32 | }
33 | });
34 | }
35 |
36 | private void SignOutClick(object sender, RoutedEventArgs e)
37 | {
38 | FirebaseUI.Instance.Client.AuthStateChanged -= this.AuthStateChanged;
39 | FirebaseUI.Instance.Client.SignOut();
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/samples/Wpf/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/samples/Wpf/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Firebase.Auth.UI;
2 | using System.Windows;
3 |
4 | namespace Firebase.Auth.Wpf.Sample
5 | {
6 | public partial class MainWindow : Window
7 | {
8 | public MainWindow()
9 | {
10 | InitializeComponent();
11 |
12 | FirebaseUI.Instance.Client.AuthStateChanged += this.AuthStateChanged;
13 | }
14 |
15 | private void AuthStateChanged(object sender, UserEventArgs e)
16 | {
17 | Application.Current.Dispatcher.Invoke(async () =>
18 | {
19 | if (e.User == null)
20 | {
21 | await FirebaseUI.Instance.Client.SignInAnonymouslyAsync();
22 | this.Frame.Navigate(new LoginPage());
23 | }
24 | else if (e.User.IsAnonymous)
25 | {
26 | this.Frame.Navigate(new LoginPage());
27 | }
28 | else if ((this.Frame.Content == null || this.Frame.Content.GetType() != typeof(MainPage)))
29 | {
30 | this.Frame.Navigate(new MainPage());
31 | }
32 | });
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/Auth.UI.UWP/Converters/AssetConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.UI.Xaml.Data;
3 |
4 | namespace Firebase.Auth.UI.Converters
5 | {
6 | public class AssetConverter : IValueConverter
7 | {
8 | public object Convert(object value, Type targetType, object parameter, string language)
9 | {
10 | return $"ms-appx:///Firebase.Auth.UI.UWP{ProviderToAssetConverter.Convert((FirebaseProviderType)value)}";
11 | }
12 |
13 | public object ConvertBack(object value, Type targetType, object parameter, string language)
14 | {
15 | throw new NotImplementedException();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Auth.UI.UWP/Converters/BackgroundConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.UI.Xaml.Data;
3 |
4 | namespace Firebase.Auth.UI.Converters
5 | {
6 | public class BackgroundConverter : IValueConverter
7 | {
8 | public object Convert(object value, Type targetType, object parameter, string language)
9 | {
10 | return ProviderToBackgroundConverter.Convert((FirebaseProviderType)value);
11 | }
12 |
13 | public object ConvertBack(object value, Type targetType, object parameter, string language)
14 | {
15 | throw new NotImplementedException();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Auth.UI.UWP/Converters/BorderThicknessConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.UI.Xaml;
3 | using Windows.UI.Xaml.Data;
4 |
5 | namespace Firebase.Auth.UI.Converters
6 | {
7 | public class BorderThicknessConverter : IValueConverter
8 | {
9 | public object Convert(object value, Type targetType, object parameter, string language)
10 | {
11 | return new Thickness((FirebaseProviderType)value == FirebaseProviderType.Google ? 1 : 0);
12 | }
13 |
14 | public object ConvertBack(object value, Type targetType, object parameter, string language)
15 | {
16 | throw new NotImplementedException();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Auth.UI.UWP/Converters/ForegroundConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.UI.Xaml.Data;
3 |
4 | namespace Firebase.Auth.UI.Converters
5 | {
6 | public class ForegroundConverter : IValueConverter
7 | {
8 | public object Convert(object value, Type targetType, object parameter, string language)
9 | {
10 | return ProviderToForegroundConverter.Convert((FirebaseProviderType)value);
11 | }
12 |
13 | public object ConvertBack(object value, Type targetType, object parameter, string language)
14 | {
15 | throw new NotImplementedException();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Auth.UI.UWP/Converters/TitleConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.UI.Xaml.Data;
3 |
4 | namespace Firebase.Auth.UI.Converters
5 | {
6 | public class TitleConverter : IValueConverter
7 | {
8 | public object Convert(object value, Type targetType, object parameter, string language)
9 | {
10 | return ProviderToTitleConverter.Convert((FirebaseProviderType)value);
11 | }
12 |
13 | public object ConvertBack(object value, Type targetType, object parameter, string language)
14 | {
15 | throw new NotImplementedException();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Auth.UI.UWP/Pages/EmailPage.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
18 |
19 |
24 |
25 |
31 |
32 |
33 |
38 |
39 |
40 |
41 |
46 |
47 |
48 |
53 |
54 |
61 |
62 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/src/Auth.UI.UWP/Pages/EmailPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Windows.UI.Xaml;
3 | using Windows.UI.Xaml.Controls;
4 | using Windows.UI.Xaml.Navigation;
5 |
6 | namespace Firebase.Auth.UI.Pages
7 | {
8 | public sealed partial class EmailPage : Page
9 | {
10 | private TaskCompletionSource tcs;
11 |
12 | public EmailPage()
13 | {
14 | this.InitializeComponent();
15 | this.Loaded += this.EmailPageLoaded;
16 | }
17 |
18 | internal Styles Styles { get; private set; }
19 |
20 | protected override void OnNavigatedTo(NavigationEventArgs e)
21 | {
22 | (var styles, var tcs, var error) = ((Styles, TaskCompletionSource, string))e.Parameter;
23 |
24 | this.tcs = tcs;
25 | this.Styles = styles;
26 |
27 | this.Progressbar.Visibility = Visibility.Collapsed;
28 | this.EnableButtons(true);
29 | this.EmailTextBox.IsEnabled = true;
30 |
31 | if (error == "")
32 | {
33 | this.EmailTextBox.Text = string.Empty;
34 | this.ErrorTextBlock.Visibility = Visibility.Collapsed;
35 | }
36 | else
37 | {
38 | this.ErrorBorder.Visibility = Visibility.Visible;
39 | this.ErrorTextBlock.Text = error;
40 | }
41 | }
42 |
43 | private void EmailPageLoaded(object sender, RoutedEventArgs e)
44 | {
45 | this.EmailTextBox.Focus(FocusState.Programmatic);
46 | }
47 |
48 | private void EnableButtons(bool enable)
49 | {
50 | this.SignInButton.IsEnabled = enable;
51 | this.CancelButton.IsEnabled = enable;
52 | }
53 |
54 | private void CancelClick(object sender, RoutedEventArgs e)
55 | {
56 | tcs.SetResult(null);
57 | }
58 |
59 | private void SignInClick(object sender, RoutedEventArgs e)
60 | {
61 | this.SignIn();
62 | }
63 |
64 | private void SignIn()
65 | {
66 | if (!this.CheckEmailAddress(this.EmailTextBox.Text))
67 | {
68 | return;
69 | }
70 |
71 | this.EmailTextBox.IsEnabled = false;
72 | this.Progressbar.Visibility = Visibility.Visible;
73 | this.EnableButtons(false);
74 | this.tcs.SetResult(this.EmailTextBox.Text);
75 | }
76 |
77 | private bool CheckEmailAddress(string email)
78 | {
79 | if (!EmailValidator.ValidateEmail(email))
80 | {
81 | this.ErrorTextBlock.Visibility = Visibility.Visible;
82 | return false;
83 | }
84 |
85 | return true;
86 | }
87 |
88 | private void EmailTextBoxKeyDown(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e)
89 | {
90 | this.ErrorTextBlock.Visibility = Visibility.Collapsed;
91 | if (e.Key == Windows.System.VirtualKey.Enter)
92 | {
93 | this.SignIn();
94 | }
95 | else if (e.Key == Windows.System.VirtualKey.Escape)
96 | {
97 | tcs.SetResult(null);
98 | }
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/src/Auth.UI.UWP/Pages/LinksFooter.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/Auth.UI.UWP/Pages/LinksFooter.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.ApplicationModel;
3 | using Windows.UI.Xaml.Controls;
4 |
5 | namespace Firebase.Auth.UI.Pages
6 | {
7 | public sealed partial class LinksFooter : UserControl
8 | {
9 | public LinksFooter()
10 | {
11 | this.InitializeComponent();
12 |
13 | if (DesignMode.DesignModeEnabled)
14 | {
15 | FirebaseUI.InitializeEmpty();
16 | }
17 |
18 | this.TosHyperlink.NavigateUri = new Uri(FirebaseUI.Instance.Config.TermsOfServiceUrl);
19 | this.PpHyperlink.NavigateUri = new Uri(FirebaseUI.Instance.Config.PrivacyPolicyUrl);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Auth.UI.UWP/Pages/RecoverPasswordPage.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
18 |
19 |
25 |
26 |
31 |
32 |
38 |
39 |
40 |
45 |
46 |
47 |
48 |
53 |
54 |
55 |
60 |
61 |
69 |
70 |
77 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/src/Auth.UI.UWP/Pages/RecoverPasswordPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Windows.UI.Core;
3 | using Windows.UI.Xaml;
4 | using Windows.UI.Xaml.Controls;
5 | using Windows.UI.Xaml.Input;
6 | using Windows.UI.Xaml.Navigation;
7 |
8 | namespace Firebase.Auth.UI.Pages
9 | {
10 | public sealed partial class RecoverPasswordPage : Page
11 | {
12 | private TaskCompletionSource