├── GoogleAuth ├── wwwroot │ ├── js │ │ ├── site.min.js │ │ └── site.js │ ├── favicon.ico │ ├── lib │ │ ├── bootstrap │ │ │ ├── dist │ │ │ │ ├── fonts │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ └── js │ │ │ │ │ └── npm.js │ │ │ ├── .bower.json │ │ │ └── LICENSE │ │ ├── jquery │ │ │ ├── .bower.json │ │ │ └── LICENSE.txt │ │ ├── jquery-validation │ │ │ ├── .bower.json │ │ │ └── LICENSE.md │ │ └── jquery-validation-unobtrusive │ │ │ ├── .bower.json │ │ │ └── jquery.validate.unobtrusive.min.js │ ├── css │ │ ├── site.min.css │ │ └── site.css │ └── images │ │ ├── banner2.svg │ │ ├── banner1.svg │ │ └── banner3.svg ├── Views │ ├── Manage │ │ ├── _ViewImports.cshtml │ │ ├── _StatusMessage.cshtml │ │ ├── _Layout.cshtml │ │ ├── _ManageNav.cshtml │ │ ├── ShowRecoveryCodes.cshtml │ │ ├── Disable2fa.cshtml │ │ ├── ResetAuthenticator.cshtml │ │ ├── GenerateRecoveryCodes.cshtml │ │ ├── SetPassword.cshtml │ │ ├── ChangePassword.cshtml │ │ ├── ManageNavPages.cs │ │ ├── Index.cshtml │ │ ├── TwoFactorAuthentication.cshtml │ │ ├── ExternalLogins.cshtml │ │ └── EnableAuthenticator.cshtml │ ├── _ViewStart.cshtml │ ├── Account │ │ ├── SignedOut.cshtml │ │ ├── ForgotPasswordConfirmation.cshtml │ │ ├── ConfirmEmail.cshtml │ │ ├── AccessDenied.cshtml │ │ ├── Lockout.cshtml │ │ ├── ResetPasswordConfirmation.cshtml │ │ ├── ForgotPassword.cshtml │ │ ├── LoginWithRecoveryCode.cshtml │ │ ├── ExternalLogin.cshtml │ │ ├── ResetPassword.cshtml │ │ ├── Register.cshtml │ │ ├── LoginWith2fa.cshtml │ │ └── Login.cshtml │ ├── Home │ │ ├── About.cshtml │ │ ├── Contact.cshtml │ │ └── Index.cshtml │ ├── _ViewImports.cshtml │ └── Shared │ │ ├── Error.cshtml │ │ ├── _LoginPartial.cshtml │ │ ├── _ValidationScriptsPartial.cshtml │ │ └── _Layout.cshtml ├── obj │ ├── Release │ │ └── netcoreapp2.0 │ │ │ ├── PubTmp │ │ │ ├── Out │ │ │ │ ├── wwwroot │ │ │ │ │ ├── js │ │ │ │ │ │ ├── site.min.js │ │ │ │ │ │ └── site.js │ │ │ │ │ ├── favicon.ico │ │ │ │ │ ├── lib │ │ │ │ │ │ ├── bootstrap │ │ │ │ │ │ │ ├── dist │ │ │ │ │ │ │ │ ├── fonts │ │ │ │ │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ │ │ │ │ └── js │ │ │ │ │ │ │ │ │ └── npm.js │ │ │ │ │ │ │ ├── .bower.json │ │ │ │ │ │ │ └── LICENSE │ │ │ │ │ │ ├── jquery │ │ │ │ │ │ │ ├── .bower.json │ │ │ │ │ │ │ └── LICENSE.txt │ │ │ │ │ │ ├── jquery-validation │ │ │ │ │ │ │ ├── .bower.json │ │ │ │ │ │ │ └── LICENSE.md │ │ │ │ │ │ └── jquery-validation-unobtrusive │ │ │ │ │ │ │ ├── .bower.json │ │ │ │ │ │ │ └── jquery.validate.unobtrusive.min.js │ │ │ │ │ ├── css │ │ │ │ │ │ ├── site.min.css │ │ │ │ │ │ └── site.css │ │ │ │ │ └── images │ │ │ │ │ │ ├── banner2.svg │ │ │ │ │ │ └── banner1.svg │ │ │ │ ├── GoogleAuth.dll │ │ │ │ ├── GoogleAuth.pdb │ │ │ │ ├── GoogleAuth.PrecompiledViews.dll │ │ │ │ ├── GoogleAuth.PrecompiledViews.pdb │ │ │ │ ├── appsettings.Development.json │ │ │ │ ├── GoogleAuth.runtimeconfig.json │ │ │ │ ├── appsettings.json │ │ │ │ ├── web.config │ │ │ │ └── bundleconfig.json │ │ │ ├── GoogleAuth.SourceManifest.xml │ │ │ └── GoogleAuth.Parameters.xml │ │ │ ├── GoogleAuth.AssemblyInfoInputs.cache │ │ │ ├── GoogleAuth.csproj.CoreCompileInputs.cache │ │ │ ├── GoogleAuth.dll │ │ │ ├── GoogleAuth.pdb │ │ │ ├── GoogleAuth.csprojResolveAssemblyReference.cache │ │ │ ├── UserSecretsAssemblyInfo.cs │ │ │ ├── GoogleAuth.AssemblyInfo.cs │ │ │ └── GoogleAuth.csproj.FileListAbsolute.txt │ ├── Debug │ │ └── netcoreapp2.0 │ │ │ ├── GoogleAuth.AssemblyInfoInputs.cache │ │ │ ├── GoogleAuth.csproj.CoreCompileInputs.cache │ │ │ ├── GoogleAuth.dll │ │ │ ├── GoogleAuth.pdb │ │ │ ├── GoogleAuth.csprojResolveAssemblyReference.cache │ │ │ ├── UserSecretsAssemblyInfo.cs │ │ │ ├── GoogleAuth.AssemblyInfo.cs │ │ │ └── GoogleAuth.csproj.FileListAbsolute.txt │ ├── Any CPU │ │ └── Release │ │ │ └── netcoreapp2.0 │ │ │ ├── GoogleAuth.AssemblyInfoInputs.cache │ │ │ ├── GoogleAuth.csproj.CoreCompileInputs.cache │ │ │ ├── GoogleAuth.dll │ │ │ ├── GoogleAuth.pdb │ │ │ ├── GoogleAuth.PrecompiledViews.dll │ │ │ ├── GoogleAuth.PrecompiledViews.pdb │ │ │ ├── GoogleAuth.csprojResolveAssemblyReference.cache │ │ │ ├── UserSecretsAssemblyInfo.cs │ │ │ ├── GoogleAuth.AssemblyInfo.cs │ │ │ ├── GoogleAuth.csproj.FileListAbsolute.txt │ │ │ └── microsoft.aspnetcore.mvc.razor.viewcompilation.rsp │ ├── GoogleAuth.csproj.nuget.cache │ ├── GoogleAuth.csproj.EntityFrameworkCore.targets │ ├── GoogleAuth.csproj.nuget.g.props │ └── GoogleAuth.csproj.nuget.g.targets ├── bin │ ├── Debug │ │ └── netcoreapp2.0 │ │ │ ├── GoogleAuth.dll │ │ │ ├── GoogleAuth.pdb │ │ │ ├── GoogleAuth.runtimeconfig.dev.json │ │ │ └── GoogleAuth.runtimeconfig.json │ ├── Release │ │ └── netcoreapp2.0 │ │ │ ├── GoogleAuth.dll │ │ │ ├── GoogleAuth.pdb │ │ │ ├── GoogleAuth.runtimeconfig.dev.json │ │ │ └── GoogleAuth.runtimeconfig.json │ └── Any CPU │ │ └── Release │ │ └── netcoreapp2.0 │ │ ├── GoogleAuth.dll │ │ ├── GoogleAuth.pdb │ │ ├── GoogleAuth.runtimeconfig.dev.json │ │ └── GoogleAuth.runtimeconfig.json ├── appsettings.Development.json ├── Models │ ├── ErrorViewModel.cs │ ├── ApplicationUser.cs │ ├── ManageViewModels │ │ ├── ShowRecoveryCodesViewModel.cs │ │ ├── RemoveLoginViewModel.cs │ │ ├── TwoFactorAuthenticationViewModel.cs │ │ ├── ExternalLoginsViewModel.cs │ │ ├── IndexViewModel.cs │ │ ├── EnableAuthenticatorViewModel.cs │ │ ├── SetPasswordViewModel.cs │ │ └── ChangePasswordViewModel.cs │ └── AccountViewModels │ │ ├── ExternalLoginViewModel.cs │ │ ├── ForgotPasswordViewModel.cs │ │ ├── LoginWithRecoveryCodeViewModel.cs │ │ ├── LoginViewModel.cs │ │ ├── LoginWith2faViewModel.cs │ │ ├── ResetPasswordViewModel.cs │ │ └── RegisterViewModel.cs ├── Services │ ├── IEmailSender.cs │ └── EmailSender.cs ├── appsettings.json ├── GoogleAuth.csproj.user ├── Properties │ ├── PublishProfiles │ │ ├── CustomProfile.pubxml.user │ │ └── CustomProfile.pubxml │ └── launchSettings.json ├── Extensions │ ├── EmailSenderExtensions.cs │ └── UrlHelperExtensions.cs ├── Program.cs ├── bundleconfig.json ├── Data │ ├── ApplicationDbContext.cs │ └── Migrations │ │ ├── 00000000000000_CreateIdentitySchema.Designer.cs │ │ ├── ApplicationDbContextModelSnapshot.cs │ │ └── 00000000000000_CreateIdentitySchema.cs ├── GoogleAuth.csproj ├── Controllers │ └── HomeController.cs └── Startup.cs ├── .vs └── GoogleAuth │ └── v15 │ ├── Server │ └── sqlite3 │ │ ├── db.lock │ │ └── storage.ide │ └── .suo ├── README.md └── GoogleAuth.sln /GoogleAuth/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.vs/GoogleAuth/v15/Server/sqlite3/db.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your JavaScript code. 2 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Manage/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using GoogleAuth.Views.Manage -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GoogleAuth/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your JavaScript code. 2 | -------------------------------------------------------------------------------- /.vs/GoogleAuth/v15/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/.vs/GoogleAuth/v15/.suo -------------------------------------------------------------------------------- /GoogleAuth/obj/Debug/netcoreapp2.0/GoogleAuth.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 4530912e1dfc376c73d9bcc33a150aed81a8c887 2 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/GoogleAuth.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 8ab07af2ebec7fd0d10f4817843d8863dd0e86a7 2 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Debug/netcoreapp2.0/GoogleAuth.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | d196568041797d3c6481b85162e215b390b2ca59 2 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/GoogleAuth.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | d196568041797d3c6481b85162e215b390b2ca59 2 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/GoogleAuth.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 8ab07af2ebec7fd0d10f4817843d8863dd0e86a7 2 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/GoogleAuth.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | d196568041797d3c6481b85162e215b390b2ca59 2 | -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/wwwroot/favicon.ico -------------------------------------------------------------------------------- /.vs/GoogleAuth/v15/Server/sqlite3/storage.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/.vs/GoogleAuth/v15/Server/sqlite3/storage.ide -------------------------------------------------------------------------------- /GoogleAuth/bin/Debug/netcoreapp2.0/GoogleAuth.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/bin/Debug/netcoreapp2.0/GoogleAuth.dll -------------------------------------------------------------------------------- /GoogleAuth/bin/Debug/netcoreapp2.0/GoogleAuth.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/bin/Debug/netcoreapp2.0/GoogleAuth.pdb -------------------------------------------------------------------------------- /GoogleAuth/obj/Debug/netcoreapp2.0/GoogleAuth.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Debug/netcoreapp2.0/GoogleAuth.dll -------------------------------------------------------------------------------- /GoogleAuth/obj/Debug/netcoreapp2.0/GoogleAuth.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Debug/netcoreapp2.0/GoogleAuth.pdb -------------------------------------------------------------------------------- /GoogleAuth/bin/Release/netcoreapp2.0/GoogleAuth.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/bin/Release/netcoreapp2.0/GoogleAuth.dll -------------------------------------------------------------------------------- /GoogleAuth/bin/Release/netcoreapp2.0/GoogleAuth.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/bin/Release/netcoreapp2.0/GoogleAuth.pdb -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/GoogleAuth.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Release/netcoreapp2.0/GoogleAuth.dll -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/GoogleAuth.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Release/netcoreapp2.0/GoogleAuth.pdb -------------------------------------------------------------------------------- /GoogleAuth/bin/Any CPU/Release/netcoreapp2.0/GoogleAuth.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/bin/Any CPU/Release/netcoreapp2.0/GoogleAuth.dll -------------------------------------------------------------------------------- /GoogleAuth/bin/Any CPU/Release/netcoreapp2.0/GoogleAuth.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/bin/Any CPU/Release/netcoreapp2.0/GoogleAuth.pdb -------------------------------------------------------------------------------- /GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/GoogleAuth.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/GoogleAuth.dll -------------------------------------------------------------------------------- /GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/GoogleAuth.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/GoogleAuth.pdb -------------------------------------------------------------------------------- /GoogleAuth/Views/Account/SignedOut.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Signed out"; 3 | } 4 | 5 |

@ViewData["Title"]

6 |

7 | You have successfully signed out. 8 |

9 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/GoogleAuth.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/GoogleAuth.dll -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/GoogleAuth.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/GoogleAuth.pdb -------------------------------------------------------------------------------- /GoogleAuth/obj/GoogleAuth.csproj.nuget.cache: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "dgSpecHash": "bcCA7BQsPYVynlrneQ4lScY/QZAp45gq8ikzG02uS0NcVeRr9Hz+DNARWiF0wUxqaPejondSBZKH/JbLHLFiIg==", 4 | "success": true 5 | } -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/favicon.ico -------------------------------------------------------------------------------- /GoogleAuth/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "About"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/GoogleAuth.PrecompiledViews.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/GoogleAuth.PrecompiledViews.dll -------------------------------------------------------------------------------- /GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/GoogleAuth.PrecompiledViews.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/GoogleAuth.PrecompiledViews.pdb -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/GoogleAuth.PrecompiledViews.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/GoogleAuth.PrecompiledViews.dll -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/GoogleAuth.PrecompiledViews.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/GoogleAuth.PrecompiledViews.pdb -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /GoogleAuth/obj/Debug/netcoreapp2.0/GoogleAuth.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Debug/netcoreapp2.0/GoogleAuth.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/GoogleAuth.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Release/netcoreapp2.0/GoogleAuth.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /GoogleAuth/Views/Account/ForgotPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Forgot password confirmation"; 3 | } 4 | 5 |

@ViewData["Title"]

6 |

7 | Please check your email to reset your password. 8 |

9 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Account/ConfirmEmail.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Confirm email"; 3 | } 4 | 5 |

@ViewData["Title"]

6 |
7 |

8 | Thank you for confirming your email. 9 |

10 |
11 | -------------------------------------------------------------------------------- /GoogleAuth/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/GoogleAuth.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/GoogleAuth.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/GoogleAuth.SourceManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Account/AccessDenied.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Access denied"; 3 | } 4 | 5 |
6 |

@ViewData["Title"]

7 |

You do not have access to this resource.

8 |
9 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Account/Lockout.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Locked out"; 3 | } 4 | 5 |
6 |

@ViewData["Title"]

7 |

This account has been locked out, please try again later.

8 |
9 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Account/ResetPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Reset password confirmation"; 3 | } 4 | 5 |

@ViewData["Title"]

6 |

7 | Your password has been reset. Please click here to log in. 8 |

9 | -------------------------------------------------------------------------------- /GoogleAuth/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Identity 2 | @using GoogleAuth 3 | @using GoogleAuth.Models 4 | @using GoogleAuth.Models.AccountViewModels 5 | @using GoogleAuth.Models.ManageViewModels 6 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 7 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /GoogleAuth/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace GoogleAuth.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnkitSharma-007/ASPCore.GoogleAuth/HEAD/GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /GoogleAuth/bin/Debug/netcoreapp2.0/GoogleAuth.runtimeconfig.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "additionalProbingPaths": [ 4 | "C:\\Users\\ankit\\.dotnet\\store\\|arch|\\|tfm|", 5 | "C:\\Users\\ankit\\.nuget\\packages", 6 | "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" 7 | ] 8 | } 9 | } -------------------------------------------------------------------------------- /GoogleAuth/bin/Debug/netcoreapp2.0/GoogleAuth.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp2.0", 4 | "framework": { 5 | "name": "Microsoft.NETCore.App", 6 | "version": "2.0.0" 7 | }, 8 | "configProperties": { 9 | "System.GC.Server": true 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /GoogleAuth/bin/Release/netcoreapp2.0/GoogleAuth.runtimeconfig.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "additionalProbingPaths": [ 4 | "C:\\Users\\ankit\\.dotnet\\store\\|arch|\\|tfm|", 5 | "C:\\Users\\ankit\\.nuget\\packages", 6 | "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" 7 | ] 8 | } 9 | } -------------------------------------------------------------------------------- /GoogleAuth/bin/Release/netcoreapp2.0/GoogleAuth.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp2.0", 4 | "framework": { 5 | "name": "Microsoft.NETCore.App", 6 | "version": "2.0.0" 7 | }, 8 | "configProperties": { 9 | "System.GC.Server": true 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /GoogleAuth/bin/Any CPU/Release/netcoreapp2.0/GoogleAuth.runtimeconfig.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "additionalProbingPaths": [ 4 | "C:\\Users\\ankit\\.dotnet\\store\\|arch|\\|tfm|", 5 | "C:\\Users\\ankit\\.nuget\\packages", 6 | "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" 7 | ] 8 | } 9 | } -------------------------------------------------------------------------------- /GoogleAuth/bin/Any CPU/Release/netcoreapp2.0/GoogleAuth.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp2.0", 4 | "framework": { 5 | "name": "Microsoft.NETCore.App", 6 | "version": "2.0.0" 7 | }, 8 | "configProperties": { 9 | "System.GC.Server": true 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/GoogleAuth.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp2.0", 4 | "framework": { 5 | "name": "Microsoft.NETCore.App", 6 | "version": "2.0.0" 7 | }, 8 | "configProperties": { 9 | "System.GC.Server": true 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /GoogleAuth/Services/IEmailSender.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace GoogleAuth.Services 7 | { 8 | public interface IEmailSender 9 | { 10 | Task SendEmailAsync(string email, string subject, string message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /GoogleAuth/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-GoogleAuth-29E55EBA-B4BA-4D26-B5EF-244C794A92CA;Trusted_Connection=True;MultipleActiveResultSets=true" 4 | }, 5 | "Logging": { 6 | "IncludeScopes": false, 7 | "LogLevel": { 8 | "Default": "Warning" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ASPCore.GoogleAuth 2 | Sometimes, we want the users to log in using their existing credentials of third-party applications, such as Facebook, Twitter, Google etc. into our application. In this article, we are going to look into authentication of ASP.NET Core app using a Google account. 3 | 4 | # Read the full article here 5 | http://ankitsharmablogs.com/authentication-using-google-asp-net-core-2-0/ 6 | -------------------------------------------------------------------------------- /GoogleAuth/Models/ApplicationUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Identity; 6 | 7 | namespace GoogleAuth.Models 8 | { 9 | // Add profile data for application users by adding properties to the ApplicationUser class 10 | public class ApplicationUser : IdentityUser 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-GoogleAuth-29E55EBA-B4BA-4D26-B5EF-244C794A92CA;Trusted_Connection=True;MultipleActiveResultSets=true" 4 | }, 5 | "Logging": { 6 | "IncludeScopes": false, 7 | "LogLevel": { 8 | "Default": "Warning" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /GoogleAuth/Models/ManageViewModels/ShowRecoveryCodesViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace GoogleAuth.Models.ManageViewModels 8 | { 9 | public class ShowRecoveryCodesViewModel 10 | { 11 | public string[] RecoveryCodes { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/GoogleAuth.Parameters.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /GoogleAuth/Models/AccountViewModels/ExternalLoginViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace GoogleAuth.Models.AccountViewModels 8 | { 9 | public class ExternalLoginViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /GoogleAuth/Models/AccountViewModels/ForgotPasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace GoogleAuth.Models.AccountViewModels 8 | { 9 | public class ForgotPasswordViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /GoogleAuth/Models/ManageViewModels/RemoveLoginViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace GoogleAuth.Models.ManageViewModels 8 | { 9 | public class RemoveLoginViewModel 10 | { 11 | public string LoginProvider { get; set; } 12 | public string ProviderKey { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Manage/_StatusMessage.cshtml: -------------------------------------------------------------------------------- 1 | @model string 2 | 3 | @if (!String.IsNullOrEmpty(Model)) 4 | { 5 | var statusMessageClass = Model.StartsWith("Error") ? "danger" : "success"; 6 | 10 | } 11 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /GoogleAuth/GoogleAuth.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ProjectDebugger 5 | 6 | 7 | GoogleAuth 8 | CustomProfile 9 | 10 | -------------------------------------------------------------------------------- /GoogleAuth/Models/AccountViewModels/LoginWithRecoveryCodeViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace GoogleAuth.Models.AccountViewModels 8 | { 9 | public class LoginWithRecoveryCodeViewModel 10 | { 11 | [Required] 12 | [DataType(DataType.Text)] 13 | [Display(Name = "Recovery Code")] 14 | public string RecoveryCode { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /GoogleAuth/Models/ManageViewModels/TwoFactorAuthenticationViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace GoogleAuth.Models.ManageViewModels 8 | { 9 | public class TwoFactorAuthenticationViewModel 10 | { 11 | public bool HasAuthenticator { get; set; } 12 | 13 | public int RecoveryCodesLeft { get; set; } 14 | 15 | public bool Is2faEnabled { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Contact"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
18 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Manage/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "/Views/Shared/_Layout.cshtml"; 3 | } 4 | 5 |

Manage your account

6 | 7 |
8 |

Change your account settings

9 |
10 |
11 |
12 | @await Html.PartialAsync("_ManageNav") 13 |
14 |
15 | @RenderBody() 16 |
17 |
18 |
19 | 20 | @section Scripts { 21 | @RenderSection("Scripts", required: false) 22 | } 23 | 24 | -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /GoogleAuth/Properties/PublishProfiles/CustomProfile.pubxml.user: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /GoogleAuth/Services/EmailSender.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace GoogleAuth.Services 7 | { 8 | // This class is used by the application to send email for account confirmation and password reset. 9 | // For more details see https://go.microsoft.com/fwlink/?LinkID=532713 10 | public class EmailSender : IEmailSender 11 | { 12 | public Task SendEmailAsync(string email, string subject, string message) 13 | { 14 | return Task.CompletedTask; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /GoogleAuth/Models/AccountViewModels/LoginViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace GoogleAuth.Models.AccountViewModels 8 | { 9 | public class LoginViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | 15 | [Required] 16 | [DataType(DataType.Password)] 17 | public string Password { get; set; } 18 | 19 | [Display(Name = "Remember me?")] 20 | public bool RememberMe { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /GoogleAuth/Models/ManageViewModels/ExternalLoginsViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Authentication; 6 | using Microsoft.AspNetCore.Identity; 7 | 8 | namespace GoogleAuth.Models.ManageViewModels 9 | { 10 | public class ExternalLoginsViewModel 11 | { 12 | public IList CurrentLogins { get; set; } 13 | 14 | public IList OtherLogins { get; set; } 15 | 16 | public bool ShowRemoveButton { get; set; } 17 | 18 | public string StatusMessage { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "2.2.0", 16 | "_release": "2.2.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "2.2.0", 20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" 21 | }, 22 | "_source": "git://github.com/jquery/jquery-dist.git", 23 | "_target": "2.2.0", 24 | "_originalSource": "jquery" 25 | } -------------------------------------------------------------------------------- /GoogleAuth/Extensions/EmailSenderExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text.Encodings.Web; 5 | using System.Threading.Tasks; 6 | using GoogleAuth.Services; 7 | 8 | namespace GoogleAuth.Services 9 | { 10 | public static class EmailSenderExtensions 11 | { 12 | public static Task SendEmailConfirmationAsync(this IEmailSender emailSender, string email, string link) 13 | { 14 | return emailSender.SendEmailAsync(email, "Confirm your email", 15 | $"Please confirm your account by clicking this link: link"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "2.2.0", 16 | "_release": "2.2.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "2.2.0", 20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" 21 | }, 22 | "_source": "git://github.com/jquery/jquery-dist.git", 23 | "_target": "2.2.0", 24 | "_originalSource": "jquery" 25 | } -------------------------------------------------------------------------------- /GoogleAuth/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace GoogleAuth 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | BuildWebHost(args).Run(); 18 | } 19 | 20 | public static IWebHost BuildWebHost(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup() 23 | .Build(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /GoogleAuth/Models/ManageViewModels/IndexViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace GoogleAuth.Models.ManageViewModels 8 | { 9 | public class IndexViewModel 10 | { 11 | public string Username { get; set; } 12 | 13 | public bool IsEmailConfirmed { get; set; } 14 | 15 | [Required] 16 | [EmailAddress] 17 | public string Email { get; set; } 18 | 19 | [Phone] 20 | [Display(Name = "Phone number")] 21 | public string PhoneNumber { get; set; } 22 | 23 | public string StatusMessage { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /GoogleAuth/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optionally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Debug/netcoreapp2.0/UserSecretsAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: Microsoft.Extensions.Configuration.UserSecrets.UserSecretsIdAttribute("aspnet-GoogleAuth-29E55EBA-B4BA-4D26-B5EF-244C794A92CA")] 15 | 16 | // Generated by the MSBuild WriteCodeFragment class. 17 | 18 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/UserSecretsAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: Microsoft.Extensions.Configuration.UserSecrets.UserSecretsIdAttribute("aspnet-GoogleAuth-29E55EBA-B4BA-4D26-B5EF-244C794A92CA")] 15 | 16 | // Generated by the MSBuild WriteCodeFragment class. 17 | 18 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optionally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/UserSecretsAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: Microsoft.Extensions.Configuration.UserSecrets.UserSecretsIdAttribute("aspnet-GoogleAuth-29E55EBA-B4BA-4D26-B5EF-244C794A92CA")] 15 | 16 | // Generated by the MSBuild WriteCodeFragment class. 17 | 18 | -------------------------------------------------------------------------------- /GoogleAuth/Models/AccountViewModels/LoginWith2faViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace GoogleAuth.Models.AccountViewModels 8 | { 9 | public class LoginWith2faViewModel 10 | { 11 | [Required] 12 | [StringLength(7, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 13 | [DataType(DataType.Text)] 14 | [Display(Name = "Authenticator code")] 15 | public string TwoFactorCode { get; set; } 16 | 17 | [Display(Name = "Remember this machine")] 18 | public bool RememberMachine { get; set; } 19 | 20 | public bool RememberMe { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /GoogleAuth/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:51791/", 7 | "sslPort": 44318 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "launchUrl": "https://localhost:44318/", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "GoogleAuth": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | }, 25 | "applicationUrl": "http://localhost:51792/" 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Wrapping element */ 7 | /* Set some basic padding to keep content from hitting the edges */ 8 | .body-content { 9 | padding-left: 15px; 10 | padding-right: 15px; 11 | } 12 | 13 | /* Carousel */ 14 | .carousel-caption p { 15 | font-size: 20px; 16 | line-height: 1.4; 17 | } 18 | 19 | /* Make .svg files in the carousel display properly in older browsers */ 20 | .carousel-inner .item img[src$=".svg"] { 21 | width: 100%; 22 | } 23 | 24 | /* QR code generator */ 25 | #qrCode { 26 | margin: 15px; 27 | } 28 | 29 | /* Hide/rearrange for smaller screens */ 30 | @media screen and (max-width: 767px) { 31 | /* Hide captions */ 32 | .carousel-caption { 33 | display: none; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Manage/_ManageNav.cshtml: -------------------------------------------------------------------------------- 1 | @using GoogleAuth.Views.Manage 2 | @inject SignInManager SignInManager 3 | @{ 4 | var hasExternalLogins = (await SignInManager.GetExternalAuthenticationSchemesAsync()).Any(); 5 | } 6 | 7 | 16 | 17 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Wrapping element */ 7 | /* Set some basic padding to keep content from hitting the edges */ 8 | .body-content { 9 | padding-left: 15px; 10 | padding-right: 15px; 11 | } 12 | 13 | /* Carousel */ 14 | .carousel-caption p { 15 | font-size: 20px; 16 | line-height: 1.4; 17 | } 18 | 19 | /* Make .svg files in the carousel display properly in older browsers */ 20 | .carousel-inner .item img[src$=".svg"] { 21 | width: 100%; 22 | } 23 | 24 | /* QR code generator */ 25 | #qrCode { 26 | margin: 15px; 27 | } 28 | 29 | /* Hide/rearrange for smaller screens */ 30 | @media screen and (max-width: 767px) { 31 | /* Hide captions */ 32 | .carousel-caption { 33 | display: none; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Account/ForgotPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model ForgotPasswordViewModel 2 | @{ 3 | ViewData["Title"] = "Forgot your password?"; 4 | } 5 | 6 |

@ViewData["Title"]

7 |

Enter your email.

8 |
9 |
10 |
11 |
12 |
13 |
14 | 15 | 16 | 17 |
18 | 19 |
20 |
21 |
22 | 23 | @section Scripts { 24 | @await Html.PartialAsync("_ValidationScriptsPartial") 25 | } 26 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Manage/ShowRecoveryCodes.cshtml: -------------------------------------------------------------------------------- 1 | @model ShowRecoveryCodesViewModel 2 | @{ 3 | ViewData["Title"] = "Recovery codes"; 4 | ViewData.AddActivePage(ManageNavPages.TwoFactorAuthentication); 5 | } 6 | 7 |

@ViewData["Title"]

8 | 17 |
18 |
19 | @for (var row = 0; row < Model.RecoveryCodes.Length; row += 2) 20 | { 21 | @Model.RecoveryCodes[row] @Model.RecoveryCodes[row + 1]
22 | } 23 |
24 |
-------------------------------------------------------------------------------- /GoogleAuth/Views/Manage/Disable2fa.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Disable two-factor authentication (2FA)"; 3 | ViewData.AddActivePage(ManageNavPages.TwoFactorAuthentication); 4 | } 5 | 6 |

@ViewData["Title"]

7 | 8 | 19 | 20 |
21 |
22 | 23 |
24 |
25 | -------------------------------------------------------------------------------- /GoogleAuth/Models/ManageViewModels/EnableAuthenticatorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using Microsoft.AspNetCore.Mvc.ModelBinding; 8 | 9 | namespace GoogleAuth.Models.ManageViewModels 10 | { 11 | public class EnableAuthenticatorViewModel 12 | { 13 | [Required] 14 | [StringLength(7, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 15 | [DataType(DataType.Text)] 16 | [Display(Name = "Verification Code")] 17 | public string Code { get; set; } 18 | 19 | [BindNever] 20 | public string SharedKey { get; set; } 21 | 22 | [BindNever] 23 | public string AuthenticatorUri { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Manage/ResetAuthenticator.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Reset authenticator key"; 3 | ViewData.AddActivePage(ManageNavPages.TwoFactorAuthentication); 4 | } 5 | 6 |

@ViewData["Title"]

7 | 17 |
18 |
19 | 20 |
21 |
-------------------------------------------------------------------------------- /GoogleAuth/Models/ManageViewModels/SetPasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace GoogleAuth.Models.ManageViewModels 8 | { 9 | public class SetPasswordViewModel 10 | { 11 | [Required] 12 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 13 | [DataType(DataType.Password)] 14 | [Display(Name = "New password")] 15 | public string NewPassword { get; set; } 16 | 17 | [DataType(DataType.Password)] 18 | [Display(Name = "Confirm new password")] 19 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] 20 | public string ConfirmPassword { get; set; } 21 | 22 | public string StatusMessage { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 22 |

23 | -------------------------------------------------------------------------------- /GoogleAuth/Data/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 6 | using Microsoft.EntityFrameworkCore; 7 | using GoogleAuth.Models; 8 | 9 | namespace GoogleAuth.Data 10 | { 11 | public class ApplicationDbContext : IdentityDbContext 12 | { 13 | public ApplicationDbContext(DbContextOptions options) 14 | : base(options) 15 | { 16 | } 17 | 18 | protected override void OnModelCreating(ModelBuilder builder) 19 | { 20 | base.OnModelCreating(builder); 21 | // Customize the ASP.NET Identity model and override the defaults if needed. 22 | // For example, you can rename the ASP.NET Identity table names and more. 23 | // Add your customizations after calling base.OnModelCreating(builder); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /GoogleAuth/GoogleAuth.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | aspnet-GoogleAuth-29E55EBA-B4BA-4D26-B5EF-244C794A92CA 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /GoogleAuth/Models/AccountViewModels/ResetPasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace GoogleAuth.Models.AccountViewModels 8 | { 9 | public class ResetPasswordViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | 15 | [Required] 16 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 17 | [DataType(DataType.Password)] 18 | public string Password { get; set; } 19 | 20 | [DataType(DataType.Password)] 21 | [Display(Name = "Confirm password")] 22 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 23 | public string ConfirmPassword { get; set; } 24 | 25 | public string Code { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /GoogleAuth/Models/AccountViewModels/RegisterViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace GoogleAuth.Models.AccountViewModels 8 | { 9 | public class RegisterViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | [Display(Name = "Email")] 14 | public string Email { get; set; } 15 | 16 | [Required] 17 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 18 | [DataType(DataType.Password)] 19 | [Display(Name = "Password")] 20 | public string Password { get; set; } 21 | 22 | [DataType(DataType.Password)] 23 | [Display(Name = "Confirm password")] 24 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 25 | public string ConfirmPassword { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /GoogleAuth/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using GoogleAuth.Models; 8 | 9 | namespace GoogleAuth.Controllers 10 | { 11 | public class HomeController : Controller 12 | { 13 | public IActionResult Index() 14 | { 15 | return View(); 16 | } 17 | 18 | public IActionResult About() 19 | { 20 | ViewData["Message"] = "Your application description page."; 21 | 22 | return View(); 23 | } 24 | 25 | public IActionResult Contact() 26 | { 27 | ViewData["Message"] = "Your contact page."; 28 | 29 | return View(); 30 | } 31 | 32 | public IActionResult Error() 33 | { 34 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Identity 2 | @using GoogleAuth.Models 3 | 4 | @inject SignInManager SignInManager 5 | @inject UserManager UserManager 6 | 7 | @if (SignInManager.IsSignedIn(User)) 8 | { 9 | 19 | } 20 | else 21 | { 22 | 26 | } 27 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Account/LoginWithRecoveryCode.cshtml: -------------------------------------------------------------------------------- 1 | @model LoginWithRecoveryCodeViewModel 2 | @{ 3 | ViewData["Title"] = "Recovery code verification"; 4 | } 5 | 6 |

@ViewData["Title"]

7 |
8 |

9 | You have requested to login with a recovery code. This login will not be remembered until you provide 10 | an authenticator app code at login or disable 2FA and login again. 11 |

12 |
13 |
14 |
15 |
16 |
17 | 18 | 19 | 20 |
21 | 22 |
23 |
24 |
25 | 26 | @section Scripts { 27 | @await Html.PartialAsync("_ValidationScriptsPartial") 28 | } -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "http://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jzaefferer/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.14.0", 31 | "_release": "1.14.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.14.0", 35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" 36 | }, 37 | "_source": "git://github.com/jzaefferer/jquery-validation.git", 38 | "_target": ">=1.8", 39 | "_originalSource": "jquery-validation" 40 | } -------------------------------------------------------------------------------- /GoogleAuth/Extensions/UrlHelperExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using GoogleAuth.Controllers; 6 | 7 | namespace Microsoft.AspNetCore.Mvc 8 | { 9 | public static class UrlHelperExtensions 10 | { 11 | public static string EmailConfirmationLink(this IUrlHelper urlHelper, string userId, string code, string scheme) 12 | { 13 | return urlHelper.Action( 14 | action: nameof(AccountController.ConfirmEmail), 15 | controller: "Account", 16 | values: new { userId, code }, 17 | protocol: scheme); 18 | } 19 | 20 | public static string ResetPasswordCallbackLink(this IUrlHelper urlHelper, string userId, string code, string scheme) 21 | { 22 | return urlHelper.Action( 23 | action: nameof(AccountController.ResetPassword), 24 | controller: "Account", 25 | values: new { userId, code }, 26 | protocol: scheme); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Manage/GenerateRecoveryCodes.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Generate two-factor authentication (2FA) recovery codes"; 3 | ViewData.AddActivePage(ManageNavPages.TwoFactorAuthentication); 4 | } 5 | 6 |

@ViewData["Title"]

7 | 8 | 21 | 22 |
23 |
24 | 25 |
26 |
27 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Debug/netcoreapp2.0/GoogleAuth.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("GoogleAuth")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("GoogleAuth")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("GoogleAuth")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // Generated by the MSBuild WriteCodeFragment class. 23 | 24 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/GoogleAuth.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("GoogleAuth")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("GoogleAuth")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("GoogleAuth")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // Generated by the MSBuild WriteCodeFragment class. 23 | 24 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/GoogleAuth.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("GoogleAuth")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("GoogleAuth")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("GoogleAuth")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // Generated by the MSBuild WriteCodeFragment class. 23 | 24 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "http://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jzaefferer/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.14.0", 31 | "_release": "1.14.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.14.0", 35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" 36 | }, 37 | "_source": "git://github.com/jzaefferer/jquery-validation.git", 38 | "_target": ">=1.8", 39 | "_originalSource": "jquery-validation" 40 | } -------------------------------------------------------------------------------- /GoogleAuth/Models/ManageViewModels/ChangePasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace GoogleAuth.Models.ManageViewModels 8 | { 9 | public class ChangePasswordViewModel 10 | { 11 | [Required] 12 | [DataType(DataType.Password)] 13 | [Display(Name = "Current password")] 14 | public string OldPassword { get; set; } 15 | 16 | [Required] 17 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 18 | [DataType(DataType.Password)] 19 | [Display(Name = "New password")] 20 | public string NewPassword { get; set; } 21 | 22 | [DataType(DataType.Password)] 23 | [Display(Name = "Confirm new password")] 24 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] 25 | public string ConfirmPassword { get; set; } 26 | 27 | public string StatusMessage { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 3" 33 | }, 34 | "version": "3.3.7", 35 | "_release": "3.3.7", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.7", 39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" 40 | }, 41 | "_source": "https://github.com/twbs/bootstrap.git", 42 | "_target": "v3.3.7", 43 | "_originalSource": "bootstrap", 44 | "_direct": true 45 | } -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2016 Twitter, Inc. 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 13 | all 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 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /GoogleAuth.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2020 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GoogleAuth", "GoogleAuth\GoogleAuth.csproj", "{FB847D65-A7B1-42DA-A092-015DEF880805}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {FB847D65-A7B1-42DA-A092-015DEF880805}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {FB847D65-A7B1-42DA-A092-015DEF880805}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {FB847D65-A7B1-42DA-A092-015DEF880805}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {FB847D65-A7B1-42DA-A092-015DEF880805}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {6536BD98-7DC4-448A-A55E-A021EF94AB78} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 3" 33 | }, 34 | "version": "3.3.7", 35 | "_release": "3.3.7", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.7", 39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" 40 | }, 41 | "_source": "https://github.com/twbs/bootstrap.git", 42 | "_target": "v3.3.7", 43 | "_originalSource": "bootstrap", 44 | "_direct": true 45 | } -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Account/ExternalLogin.cshtml: -------------------------------------------------------------------------------- 1 | @model ExternalLoginViewModel 2 | @{ 3 | ViewData["Title"] = "Register"; 4 | } 5 | 6 |

@ViewData["Title"]

7 |

Associate your @ViewData["LoginProvider"] account.

8 |
9 | 10 |

11 | You've successfully authenticated with @ViewData["LoginProvider"]. 12 | Please enter an email address for this site below and click the Register button to finish 13 | logging in. 14 |

15 | 16 |
17 |
18 |
19 |
20 |
21 | 22 | 23 | 24 |
25 | 26 |
27 |
28 |
29 | 30 | @section Scripts { 31 | @await Html.PartialAsync("_ValidationScriptsPartial") 32 | } 33 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2016 Twitter, Inc. 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 13 | all 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 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Debug/netcoreapp2.0/GoogleAuth.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\bin\Debug\netcoreapp2.0\GoogleAuth.deps.json 2 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\bin\Debug\netcoreapp2.0\GoogleAuth.runtimeconfig.json 3 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\bin\Debug\netcoreapp2.0\GoogleAuth.runtimeconfig.dev.json 4 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\bin\Debug\netcoreapp2.0\GoogleAuth.dll 5 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\bin\Debug\netcoreapp2.0\GoogleAuth.pdb 6 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Debug\netcoreapp2.0\GoogleAuth.csprojResolveAssemblyReference.cache 7 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Debug\netcoreapp2.0\GoogleAuth.csproj.CoreCompileInputs.cache 8 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Debug\netcoreapp2.0\UserSecretsAssemblyInfo.cs 9 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Debug\netcoreapp2.0\GoogleAuth.AssemblyInfoInputs.cache 10 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Debug\netcoreapp2.0\GoogleAuth.AssemblyInfo.cs 11 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Debug\netcoreapp2.0\GoogleAuth.dll 12 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Debug\netcoreapp2.0\GoogleAuth.pdb 13 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/GoogleAuth.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\bin\Release\netcoreapp2.0\GoogleAuth.deps.json 2 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\bin\Release\netcoreapp2.0\GoogleAuth.runtimeconfig.json 3 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\bin\Release\netcoreapp2.0\GoogleAuth.runtimeconfig.dev.json 4 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\bin\Release\netcoreapp2.0\GoogleAuth.dll 5 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\bin\Release\netcoreapp2.0\GoogleAuth.pdb 6 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Release\netcoreapp2.0\GoogleAuth.csprojResolveAssemblyReference.cache 7 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Release\netcoreapp2.0\GoogleAuth.csproj.CoreCompileInputs.cache 8 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Release\netcoreapp2.0\UserSecretsAssemblyInfo.cs 9 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Release\netcoreapp2.0\GoogleAuth.AssemblyInfoInputs.cache 10 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Release\netcoreapp2.0\GoogleAuth.AssemblyInfo.cs 11 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Release\netcoreapp2.0\GoogleAuth.dll 12 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Release\netcoreapp2.0\GoogleAuth.pdb 13 | -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "version": "3.2.6", 4 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 5 | "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.", 6 | "main": [ 7 | "jquery.validate.unobtrusive.js" 8 | ], 9 | "ignore": [ 10 | "**/.*", 11 | "*.json", 12 | "*.md", 13 | "*.txt", 14 | "gulpfile.js" 15 | ], 16 | "keywords": [ 17 | "jquery", 18 | "asp.net", 19 | "mvc", 20 | "validation", 21 | "unobtrusive" 22 | ], 23 | "authors": [ 24 | "Microsoft" 25 | ], 26 | "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", 27 | "repository": { 28 | "type": "git", 29 | "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git" 30 | }, 31 | "dependencies": { 32 | "jquery-validation": ">=1.8", 33 | "jquery": ">=1.8" 34 | }, 35 | "_release": "3.2.6", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.2.6", 39 | "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7" 40 | }, 41 | "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git", 42 | "_target": "3.2.6", 43 | "_originalSource": "jquery-validation-unobtrusive" 44 | } -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "version": "3.2.6", 4 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 5 | "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.", 6 | "main": [ 7 | "jquery.validate.unobtrusive.js" 8 | ], 9 | "ignore": [ 10 | "**/.*", 11 | "*.json", 12 | "*.md", 13 | "*.txt", 14 | "gulpfile.js" 15 | ], 16 | "keywords": [ 17 | "jquery", 18 | "asp.net", 19 | "mvc", 20 | "validation", 21 | "unobtrusive" 22 | ], 23 | "authors": [ 24 | "Microsoft" 25 | ], 26 | "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", 27 | "repository": { 28 | "type": "git", 29 | "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git" 30 | }, 31 | "dependencies": { 32 | "jquery-validation": ">=1.8", 33 | "jquery": ">=1.8" 34 | }, 35 | "_release": "3.2.6", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.2.6", 39 | "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7" 40 | }, 41 | "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git", 42 | "_target": "3.2.6", 43 | "_originalSource": "jquery-validation-unobtrusive" 44 | } -------------------------------------------------------------------------------- /GoogleAuth/Properties/PublishProfiles/CustomProfile.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | MSDeploy 9 | Release 10 | Any CPU 11 | http://localhost/GoogleAuth 12 | True 13 | False 14 | netcoreapp2.0 15 | fb847d65-a7b1-42da-a092-015def880805 16 | localhost 17 | Default Web Site/GoogleAuth 18 | 19 | True 20 | InProc 21 | False 22 | 23 | <_SavePWD>False 24 | 25 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Manage/SetPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model SetPasswordViewModel 2 | @{ 3 | ViewData["Title"] = "Set password"; 4 | ViewData.AddActivePage(ManageNavPages.ChangePassword); 5 | } 6 | 7 |

Set your password

8 | @Html.Partial("_StatusMessage", Model.StatusMessage) 9 |

10 | You do not have a local username/password for this site. Add a local 11 | account so you can log in without an external login. 12 |

13 |
14 |
15 |
16 |
17 |
18 | 19 | 20 | 21 |
22 |
23 | 24 | 25 | 26 |
27 | 28 |
29 |
30 |
31 | 32 | @section Scripts { 33 | @await Html.PartialAsync("_ValidationScriptsPartial") 34 | } 35 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/GoogleAuth.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\bin\Any CPU\Release\netcoreapp2.0\GoogleAuth.deps.json 2 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\bin\Any CPU\Release\netcoreapp2.0\GoogleAuth.runtimeconfig.json 3 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\bin\Any CPU\Release\netcoreapp2.0\GoogleAuth.runtimeconfig.dev.json 4 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\bin\Any CPU\Release\netcoreapp2.0\GoogleAuth.dll 5 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\bin\Any CPU\Release\netcoreapp2.0\GoogleAuth.pdb 6 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Any CPU\Release\netcoreapp2.0\GoogleAuth.csprojResolveAssemblyReference.cache 7 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Any CPU\Release\netcoreapp2.0\GoogleAuth.csproj.CoreCompileInputs.cache 8 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Any CPU\Release\netcoreapp2.0\UserSecretsAssemblyInfo.cs 9 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Any CPU\Release\netcoreapp2.0\GoogleAuth.AssemblyInfoInputs.cache 10 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Any CPU\Release\netcoreapp2.0\GoogleAuth.AssemblyInfo.cs 11 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Any CPU\Release\netcoreapp2.0\GoogleAuth.dll 12 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\Any CPU\Release\netcoreapp2.0\GoogleAuth.pdb 13 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Account/ResetPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model ResetPasswordViewModel 2 | @{ 3 | ViewData["Title"] = "Reset password"; 4 | } 5 | 6 |

@ViewData["Title"]

7 |

Reset your password.

8 |
9 |
10 |
11 |
12 |
13 | 14 |
15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 |
24 |
25 | 26 | 27 | 28 |
29 | 30 |
31 |
32 |
33 | 34 | @section Scripts { 35 | @await Html.PartialAsync("_ValidationScriptsPartial") 36 | } 37 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Account/Register.cshtml: -------------------------------------------------------------------------------- 1 | @model RegisterViewModel 2 | @{ 3 | ViewData["Title"] = "Register"; 4 | } 5 | 6 |

@ViewData["Title"]

7 | 8 |
9 |
10 |
11 |

Create a new account.

12 |
13 |
14 |
15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 |
24 |
25 | 26 | 27 | 28 |
29 | 30 |
31 |
32 |
33 | 34 | @section Scripts { 35 | @await Html.PartialAsync("_ValidationScriptsPartial") 36 | } 37 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Manage/ChangePassword.cshtml: -------------------------------------------------------------------------------- 1 | @model ChangePasswordViewModel 2 | @{ 3 | ViewData["Title"] = "Change password"; 4 | ViewData.AddActivePage(ManageNavPages.ChangePassword); 5 | } 6 | 7 |

@ViewData["Title"]

8 | @Html.Partial("_StatusMessage", Model.StatusMessage) 9 |
10 |
11 |
12 |
13 |
14 | 15 | 16 | 17 |
18 |
19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 |
28 | 29 |
30 |
31 |
32 | 33 | @section Scripts { 34 | @await Html.PartialAsync("_ValidationScriptsPartial") 35 | } 36 | -------------------------------------------------------------------------------- /GoogleAuth/obj/GoogleAuth.csproj.EntityFrameworkCore.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /GoogleAuth/obj/GoogleAuth.csproj.nuget.g.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | True 5 | NuGet 6 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\obj\project.assets.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\ankit\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder 9 | PackageReference 10 | 4.5.0 11 | 12 | 13 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Manage/ManageNavPages.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc.Rendering; 6 | using Microsoft.AspNetCore.Mvc.ViewFeatures; 7 | 8 | namespace GoogleAuth.Views.Manage 9 | { 10 | public static class ManageNavPages 11 | { 12 | public static string ActivePageKey => "ActivePage"; 13 | 14 | public static string Index => "Index"; 15 | 16 | public static string ChangePassword => "ChangePassword"; 17 | 18 | public static string ExternalLogins => "ExternalLogins"; 19 | 20 | public static string TwoFactorAuthentication => "TwoFactorAuthentication"; 21 | 22 | public static string IndexNavClass(ViewContext viewContext) => PageNavClass(viewContext, Index); 23 | 24 | public static string ChangePasswordNavClass(ViewContext viewContext) => PageNavClass(viewContext, ChangePassword); 25 | 26 | public static string ExternalLoginsNavClass(ViewContext viewContext) => PageNavClass(viewContext, ExternalLogins); 27 | 28 | public static string TwoFactorAuthenticationNavClass(ViewContext viewContext) => PageNavClass(viewContext, TwoFactorAuthentication); 29 | 30 | public static string PageNavClass(ViewContext viewContext, string page) 31 | { 32 | var activePage = viewContext.ViewData["ActivePage"] as string; 33 | return string.Equals(activePage, page, StringComparison.OrdinalIgnoreCase) ? "active" : null; 34 | } 35 | 36 | public static void AddActivePage(this ViewDataDictionary viewData, string activePage) => viewData[ActivePageKey] = activePage; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Account/LoginWith2fa.cshtml: -------------------------------------------------------------------------------- 1 | @model LoginWith2faViewModel 2 | @{ 3 | ViewData["Title"] = "Two-factor authentication"; 4 | } 5 | 6 |

@ViewData["Title"]

7 |
8 |

Your login is protected with an authenticator app. Enter your authenticator code below.

9 |
10 |
11 |
12 | 13 |
14 |
15 | 16 | 17 | 18 |
19 |
20 |
21 | 25 |
26 |
27 |
28 | 29 |
30 |
31 |
32 |
33 |

34 | Don't have access to your authenticator device? You can 35 | log in with a recovery code. 36 |

37 | 38 | @section Scripts { 39 | @await Html.PartialAsync("_ValidationScriptsPartial") 40 | } -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Manage/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IndexViewModel 2 | @{ 3 | ViewData["Title"] = "Profile"; 4 | ViewData.AddActivePage(ManageNavPages.Index); 5 | } 6 | 7 |

@ViewData["Title"]

8 | @Html.Partial("_StatusMessage", Model.StatusMessage) 9 |
10 |
11 |
12 |
13 |
14 | 15 | 16 |
17 |
18 | 19 | @if (Model.IsEmailConfirmed) 20 | { 21 |
22 | 23 | 24 |
25 | } 26 | else 27 | { 28 | 29 | 30 | } 31 | 32 |
33 |
34 | 35 | 36 | 37 |
38 | 39 |
40 |
41 |
42 | 43 | @section Scripts { 44 | @await Html.PartialAsync("_ValidationScriptsPartial") 45 | } 46 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Manage/TwoFactorAuthentication.cshtml: -------------------------------------------------------------------------------- 1 | @model TwoFactorAuthenticationViewModel 2 | @{ 3 | ViewData["Title"] = "Two-factor authentication"; 4 | ViewData.AddActivePage(ManageNavPages.TwoFactorAuthentication); 5 | } 6 | 7 |

@ViewData["Title"]

8 | @if (Model.Is2faEnabled) 9 | { 10 | if (Model.RecoveryCodesLeft == 0) 11 | { 12 |
13 | You have no recovery codes left. 14 |

You must generate a new set of recovery codes before you can log in with a recovery code.

15 |
16 | } 17 | else if (Model.RecoveryCodesLeft == 1) 18 | { 19 |
20 | You have 1 recovery code left. 21 |

You can generate a new set of recovery codes.

22 |
23 | } 24 | else if (Model.RecoveryCodesLeft <= 3) 25 | { 26 |
27 | You have @Model.RecoveryCodesLeft recovery codes left. 28 |

You should generate a new set of recovery codes.

29 |
30 | } 31 | 32 | Disable 2FA 33 | Reset recovery codes 34 | } 35 | 36 |
Authenticator app
37 | @if (!Model.HasAuthenticator) 38 | { 39 | Add authenticator app 40 | } 41 | else 42 | { 43 | Configure authenticator app 44 | Reset authenticator key 45 | } 46 | 47 | @section Scripts { 48 | @await Html.PartialAsync("_ValidationScriptsPartial") 49 | } 50 | -------------------------------------------------------------------------------- /GoogleAuth/obj/GoogleAuth.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Manage/ExternalLogins.cshtml: -------------------------------------------------------------------------------- 1 | @model ExternalLoginsViewModel 2 | @{ 3 | ViewData["Title"] = "Manage your external logins"; 4 | ViewData.AddActivePage(ManageNavPages.ExternalLogins); 5 | } 6 | 7 | @Html.Partial("_StatusMessage", Model.StatusMessage) 8 | @if (Model.CurrentLogins?.Count > 0) 9 | { 10 |

Registered Logins

11 | 12 | 13 | @foreach (var login in Model.CurrentLogins) 14 | { 15 | 16 | 17 | 33 | 34 | } 35 | 36 |
@login.LoginProvider 18 | @if (Model.ShowRemoveButton) 19 | { 20 |
21 |
22 | 23 | 24 | 25 |
26 |
27 | } 28 | else 29 | { 30 | @:   31 | } 32 |
37 | } 38 | @if (Model.OtherLogins?.Count > 0) 39 | { 40 |

Add another service to log in.

41 |
42 |
43 |
44 |

45 | @foreach (var provider in Model.OtherLogins) 46 | { 47 | 48 | } 49 |

50 |
51 |
52 | } 53 | -------------------------------------------------------------------------------- /GoogleAuth/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Identity; 7 | using Microsoft.EntityFrameworkCore; 8 | using Microsoft.AspNetCore.Hosting; 9 | using Microsoft.Extensions.Configuration; 10 | using Microsoft.Extensions.DependencyInjection; 11 | using GoogleAuth.Data; 12 | using GoogleAuth.Models; 13 | using GoogleAuth.Services; 14 | 15 | namespace GoogleAuth 16 | { 17 | public class Startup 18 | { 19 | public Startup(IConfiguration configuration) 20 | { 21 | Configuration = configuration; 22 | } 23 | 24 | public IConfiguration Configuration { get; } 25 | 26 | // This method gets called by the runtime. Use this method to add services to the container. 27 | public void ConfigureServices(IServiceCollection services) 28 | { 29 | services.AddDbContext(options => 30 | options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); 31 | 32 | services.AddIdentity() 33 | .AddEntityFrameworkStores() 34 | .AddDefaultTokenProviders(); 35 | 36 | services.AddAuthentication().AddGoogle(googleOptions => 37 | { 38 | googleOptions.ClientId = Configuration["Authentication:Google:ClientId"]; 39 | googleOptions.ClientSecret = Configuration["Authentication:Google:ClientSecret"]; 40 | }); 41 | 42 | // Add application services. 43 | services.AddTransient(); 44 | 45 | services.AddMvc(); 46 | } 47 | 48 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 49 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 50 | { 51 | if (env.IsDevelopment()) 52 | { 53 | app.UseBrowserLink(); 54 | app.UseDeveloperExceptionPage(); 55 | app.UseDatabaseErrorPage(); 56 | } 57 | else 58 | { 59 | app.UseExceptionHandler("/Home/Error"); 60 | } 61 | 62 | app.UseStaticFiles(); 63 | 64 | app.UseAuthentication(); 65 | 66 | app.UseMvc(routes => 67 | { 68 | routes.MapRoute( 69 | name: "default", 70 | template: "{controller=Home}/{action=Index}/{id?}"); 71 | }); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Manage/EnableAuthenticator.cshtml: -------------------------------------------------------------------------------- 1 | @model EnableAuthenticatorViewModel 2 | @{ 3 | ViewData["Title"] = "Enable authenticator"; 4 | ViewData.AddActivePage(ManageNavPages.TwoFactorAuthentication); 5 | } 6 | 7 |

@ViewData["Title"]

8 |
9 |

To use an authenticator app go through the following steps:

10 |
    11 |
  1. 12 |

    13 | Download a two-factor authenticator app like Microsoft Authenticator for 14 | Windows Phone, 15 | Android and 16 | iOS or 17 | Google Authenticator for 18 | Android and 19 | iOS. 20 |

    21 |
  2. 22 |
  3. 23 |

    Scan the QR Code or enter this key @Model.SharedKey into your two factor authenticator app. Spaces and casing do not matter.

    24 |
    To enable QR code generation please read our documentation.
    25 |
    26 |
    27 |
  4. 28 |
  5. 29 |

    30 | Once you have scanned the QR code or input the key above, your two factor authentication app will provide you 31 | with a unique code. Enter the code in the confirmation box below. 32 |

    33 |
    34 |
    35 |
    36 |
    37 | 38 | 39 | 40 |
    41 | 42 |
    43 |
    44 |
    45 |
    46 |
  6. 47 |
48 |
49 | 50 | @section Scripts { 51 | @await Html.PartialAsync("_ValidationScriptsPartial") 52 | } 53 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Any CPU/Release/netcoreapp2.0/microsoft.aspnetcore.mvc.razor.viewcompilation.rsp: -------------------------------------------------------------------------------- 1 | C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth 2 | --output-path=obj\Any CPU\Release\netcoreapp2.0\ 3 | --application-name=GoogleAuth 4 | --content-root=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth 5 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Account\AccessDenied.cshtml 6 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Account\ConfirmEmail.cshtml 7 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Account\ExternalLogin.cshtml 8 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Account\ForgotPassword.cshtml 9 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Account\ForgotPasswordConfirmation.cshtml 10 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Account\Lockout.cshtml 11 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Account\Login.cshtml 12 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Account\LoginWith2fa.cshtml 13 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Account\LoginWithRecoveryCode.cshtml 14 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Account\Register.cshtml 15 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Account\ResetPassword.cshtml 16 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Account\ResetPasswordConfirmation.cshtml 17 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Account\SignedOut.cshtml 18 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Home\About.cshtml 19 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Home\Contact.cshtml 20 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Home\Index.cshtml 21 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Manage\ChangePassword.cshtml 22 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Manage\Disable2fa.cshtml 23 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Manage\EnableAuthenticator.cshtml 24 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Manage\ExternalLogins.cshtml 25 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Manage\GenerateRecoveryCodes.cshtml 26 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Manage\Index.cshtml 27 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Manage\ResetAuthenticator.cshtml 28 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Manage\SetPassword.cshtml 29 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Manage\ShowRecoveryCodes.cshtml 30 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Manage\TwoFactorAuthentication.cshtml 31 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Manage\_Layout.cshtml 32 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Manage\_ManageNav.cshtml 33 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Manage\_StatusMessage.cshtml 34 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Manage\_ViewImports.cshtml 35 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Shared\Error.cshtml 36 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Shared\_Layout.cshtml 37 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Shared\_LoginPartial.cshtml 38 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\Shared\_ValidationScriptsPartial.cshtml 39 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\_ViewImports.cshtml 40 | --file=C:\Users\ankit\source\repos\GoogleAuth\GoogleAuth\Views\_ViewStart.cshtml 41 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - GoogleAuth 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 41 |
42 | @RenderBody() 43 |
44 |
45 |

© 2018 - GoogleAuth

46 |
47 |
48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 61 | 67 | 68 | 69 | 70 | @RenderSection("Scripts", required: false) 71 | 72 | 73 | -------------------------------------------------------------------------------- /GoogleAuth/Views/Account/Login.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Collections.Generic 2 | @using System.Linq 3 | @using Microsoft.AspNetCore.Http 4 | @using Microsoft.AspNetCore.Http.Authentication 5 | @model LoginViewModel 6 | @inject SignInManager SignInManager 7 | 8 | @{ 9 | ViewData["Title"] = "Log in"; 10 | } 11 | 12 |

@ViewData["Title"]

13 |
14 |
15 |
16 |
17 |

Use a local account to log in.

18 |
19 |
20 |
21 | 22 | 23 | 24 |
25 |
26 | 27 | 28 | 29 |
30 |
31 |
32 | 36 |
37 |
38 |
39 | 40 |
41 |
42 |

43 | Forgot your password? 44 |

45 |

46 | Register as a new user? 47 |

48 |
49 |
50 |
51 |
52 |
53 |
54 |

Use another service to log in.

55 |
56 | @{ 57 | var loginProviders = (await SignInManager.GetExternalAuthenticationSchemesAsync()).ToList(); 58 | if (loginProviders.Count == 0) 59 | { 60 |
61 |

62 | There are no external authentication services configured. See this article 63 | for details on setting up this ASP.NET application to support logging in via external services. 64 |

65 |
66 | } 67 | else 68 | { 69 |
70 |
71 |

72 | @foreach (var provider in loginProviders) 73 | { 74 | 75 | } 76 |

77 |
78 |
79 | } 80 | } 81 |
82 |
83 |
84 | 85 | @section Scripts { 86 | @await Html.PartialAsync("_ValidationScriptsPartial") 87 | } 88 | -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** Unobtrusive validation support library for jQuery and jQuery Validate 3 | ** Copyright (C) Microsoft Corporation. All rights reserved. 4 | */ 5 | !function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a("
  • ").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function m(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=p.unobtrusive.options||{},m=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),m("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),m("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),m("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var u,p=a.validator,v="unobtrusiveValidation";p.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=m(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){p.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=m(this);a&&a.attachValidation()})}},u=p.unobtrusive.adapters,u.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},u.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},u.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},u.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},p.addMethod("__dummy__",function(a,e,n){return!0}),p.addMethod("regex",function(a,e,n){var t;return this.optional(e)?!0:(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),p.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),p.methods.extension?(u.addSingleVal("accept","mimtype"),u.addSingleVal("extension","extension")):u.addSingleVal("extension","extension","accept"),u.addSingleVal("regex","pattern"),u.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),u.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),u.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),u.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),u.add("required",function(a){("INPUT"!==a.element.tagName.toUpperCase()||"CHECKBOX"!==a.element.type.toUpperCase())&&e(a,"required",!0)}),u.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var r=i(n,s);d.data[r]=function(){var e=a(o.form).find(":input").filter("[name='"+t(r)+"']");return e.is(":checkbox")?e.filter(":checked").val()||e.filter(":hidden").val()||"":e.is(":radio")?e.filter(":checked").val()||"":e.val()}}),e(o,"remote",d)}),u.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&e(a,"minlength",a.params.min),a.params.nonalphamin&&e(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&e(a,"regex",a.params.regex)}),a(function(){p.unobtrusive.parse(document)})}(jQuery); -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** Unobtrusive validation support library for jQuery and jQuery Validate 3 | ** Copyright (C) Microsoft Corporation. All rights reserved. 4 | */ 5 | !function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a("
  • ").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function m(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=p.unobtrusive.options||{},m=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),m("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),m("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),m("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var u,p=a.validator,v="unobtrusiveValidation";p.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=m(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){p.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=m(this);a&&a.attachValidation()})}},u=p.unobtrusive.adapters,u.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},u.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},u.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},u.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},p.addMethod("__dummy__",function(a,e,n){return!0}),p.addMethod("regex",function(a,e,n){var t;return this.optional(e)?!0:(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),p.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),p.methods.extension?(u.addSingleVal("accept","mimtype"),u.addSingleVal("extension","extension")):u.addSingleVal("extension","extension","accept"),u.addSingleVal("regex","pattern"),u.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),u.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),u.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),u.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),u.add("required",function(a){("INPUT"!==a.element.tagName.toUpperCase()||"CHECKBOX"!==a.element.type.toUpperCase())&&e(a,"required",!0)}),u.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var r=i(n,s);d.data[r]=function(){var e=a(o.form).find(":input").filter("[name='"+t(r)+"']");return e.is(":checkbox")?e.filter(":checked").val()||e.filter(":hidden").val()||"":e.is(":radio")?e.filter(":checked").val()||"":e.val()}}),e(o,"remote",d)}),u.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&e(a,"minlength",a.params.min),a.params.nonalphamin&&e(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&e(a,"regex",a.params.regex)}),a(function(){p.unobtrusive.parse(document)})}(jQuery); -------------------------------------------------------------------------------- /GoogleAuth/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 | 67 | 68 | 107 | -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/images/banner2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/images/banner2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GoogleAuth/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.EntityFrameworkCore; 6 | using Microsoft.EntityFrameworkCore.Infrastructure; 7 | using Microsoft.EntityFrameworkCore.Metadata; 8 | using Microsoft.EntityFrameworkCore.Migrations; 9 | 10 | namespace GoogleAuth.Data.Migrations 11 | { 12 | [DbContext(typeof(ApplicationDbContext))] 13 | [Migration("00000000000000_CreateIdentitySchema")] 14 | partial class CreateIdentitySchema 15 | { 16 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 17 | { 18 | modelBuilder 19 | .HasAnnotation("ProductVersion", "1.0.0-rc3") 20 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 21 | 22 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => 23 | { 24 | b.Property("Id"); 25 | 26 | b.Property("ConcurrencyStamp") 27 | .IsConcurrencyToken(); 28 | 29 | b.Property("Name") 30 | .HasAnnotation("MaxLength", 256); 31 | 32 | b.Property("NormalizedName") 33 | .HasAnnotation("MaxLength", 256); 34 | 35 | b.HasKey("Id"); 36 | 37 | b.HasIndex("NormalizedName") 38 | .HasName("RoleNameIndex"); 39 | 40 | b.ToTable("AspNetRoles"); 41 | }); 42 | 43 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => 44 | { 45 | b.Property("Id") 46 | .ValueGeneratedOnAdd(); 47 | 48 | b.Property("ClaimType"); 49 | 50 | b.Property("ClaimValue"); 51 | 52 | b.Property("RoleId") 53 | .IsRequired(); 54 | 55 | b.HasKey("Id"); 56 | 57 | b.HasIndex("RoleId"); 58 | 59 | b.ToTable("AspNetRoleClaims"); 60 | }); 61 | 62 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => 63 | { 64 | b.Property("Id") 65 | .ValueGeneratedOnAdd(); 66 | 67 | b.Property("ClaimType"); 68 | 69 | b.Property("ClaimValue"); 70 | 71 | b.Property("UserId") 72 | .IsRequired(); 73 | 74 | b.HasKey("Id"); 75 | 76 | b.HasIndex("UserId"); 77 | 78 | b.ToTable("AspNetUserClaims"); 79 | }); 80 | 81 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => 82 | { 83 | b.Property("LoginProvider"); 84 | 85 | b.Property("ProviderKey"); 86 | 87 | b.Property("ProviderDisplayName"); 88 | 89 | b.Property("UserId") 90 | .IsRequired(); 91 | 92 | b.HasKey("LoginProvider", "ProviderKey"); 93 | 94 | b.HasIndex("UserId"); 95 | 96 | b.ToTable("AspNetUserLogins"); 97 | }); 98 | 99 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => 100 | { 101 | b.Property("UserId"); 102 | 103 | b.Property("RoleId"); 104 | 105 | b.HasKey("UserId", "RoleId"); 106 | 107 | b.HasIndex("RoleId"); 108 | 109 | b.HasIndex("UserId"); 110 | 111 | b.ToTable("AspNetUserRoles"); 112 | }); 113 | 114 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => 115 | { 116 | b.Property("UserId"); 117 | 118 | b.Property("LoginProvider"); 119 | 120 | b.Property("Name"); 121 | 122 | b.Property("Value"); 123 | 124 | b.HasKey("UserId", "LoginProvider", "Name"); 125 | 126 | b.ToTable("AspNetUserTokens"); 127 | }); 128 | 129 | modelBuilder.Entity("GoogleAuth.Models.ApplicationUser", b => 130 | { 131 | b.Property("Id"); 132 | 133 | b.Property("AccessFailedCount"); 134 | 135 | b.Property("ConcurrencyStamp") 136 | .IsConcurrencyToken(); 137 | 138 | b.Property("Email") 139 | .HasAnnotation("MaxLength", 256); 140 | 141 | b.Property("EmailConfirmed"); 142 | 143 | b.Property("LockoutEnabled"); 144 | 145 | b.Property("LockoutEnd"); 146 | 147 | b.Property("NormalizedEmail") 148 | .HasAnnotation("MaxLength", 256); 149 | 150 | b.Property("NormalizedUserName") 151 | .HasAnnotation("MaxLength", 256); 152 | 153 | b.Property("PasswordHash"); 154 | 155 | b.Property("PhoneNumber"); 156 | 157 | b.Property("PhoneNumberConfirmed"); 158 | 159 | b.Property("SecurityStamp"); 160 | 161 | b.Property("TwoFactorEnabled"); 162 | 163 | b.Property("UserName") 164 | .HasAnnotation("MaxLength", 256); 165 | 166 | b.HasKey("Id"); 167 | 168 | b.HasIndex("NormalizedEmail") 169 | .HasName("EmailIndex"); 170 | 171 | b.HasIndex("NormalizedUserName") 172 | .IsUnique() 173 | .HasName("UserNameIndex"); 174 | 175 | b.ToTable("AspNetUsers"); 176 | }); 177 | 178 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => 179 | { 180 | b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") 181 | .WithMany("Claims") 182 | .HasForeignKey("RoleId") 183 | .OnDelete(DeleteBehavior.Cascade); 184 | }); 185 | 186 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => 187 | { 188 | b.HasOne("GoogleAuth.Models.ApplicationUser") 189 | .WithMany("Claims") 190 | .HasForeignKey("UserId") 191 | .OnDelete(DeleteBehavior.Cascade); 192 | }); 193 | 194 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => 195 | { 196 | b.HasOne("GoogleAuth.Models.ApplicationUser") 197 | .WithMany("Logins") 198 | .HasForeignKey("UserId") 199 | .OnDelete(DeleteBehavior.Cascade); 200 | }); 201 | 202 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => 203 | { 204 | b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") 205 | .WithMany("Users") 206 | .HasForeignKey("RoleId") 207 | .OnDelete(DeleteBehavior.Cascade); 208 | 209 | b.HasOne("GoogleAuth.Models.ApplicationUser") 210 | .WithMany("Roles") 211 | .HasForeignKey("UserId") 212 | .OnDelete(DeleteBehavior.Cascade); 213 | }); 214 | } 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /GoogleAuth/Data/Migrations/ApplicationDbContextModelSnapshot.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.EntityFrameworkCore; 6 | using Microsoft.EntityFrameworkCore.Infrastructure; 7 | using Microsoft.EntityFrameworkCore.Metadata; 8 | using Microsoft.EntityFrameworkCore.Migrations; 9 | 10 | namespace GoogleAuth.Data.Migrations 11 | { 12 | [DbContext(typeof(ApplicationDbContext))] 13 | partial class ApplicationDbContextModelSnapshot : ModelSnapshot 14 | { 15 | protected override void BuildModel(ModelBuilder modelBuilder) 16 | { 17 | modelBuilder 18 | .HasAnnotation("ProductVersion", "1.0.0-rc3") 19 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 20 | 21 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => 22 | { 23 | b.Property("Id"); 24 | 25 | b.Property("ConcurrencyStamp") 26 | .IsConcurrencyToken(); 27 | 28 | b.Property("Name") 29 | .HasAnnotation("MaxLength", 256); 30 | 31 | b.Property("NormalizedName") 32 | .HasAnnotation("MaxLength", 256); 33 | 34 | b.HasKey("Id"); 35 | 36 | b.HasIndex("NormalizedName") 37 | .HasName("RoleNameIndex"); 38 | 39 | b.ToTable("AspNetRoles"); 40 | }); 41 | 42 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => 43 | { 44 | b.Property("Id") 45 | .ValueGeneratedOnAdd(); 46 | 47 | b.Property("ClaimType"); 48 | 49 | b.Property("ClaimValue"); 50 | 51 | b.Property("RoleId") 52 | .IsRequired(); 53 | 54 | b.HasKey("Id"); 55 | 56 | b.HasIndex("RoleId"); 57 | 58 | b.ToTable("AspNetRoleClaims"); 59 | }); 60 | 61 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => 62 | { 63 | b.Property("Id") 64 | .ValueGeneratedOnAdd(); 65 | 66 | b.Property("ClaimType"); 67 | 68 | b.Property("ClaimValue"); 69 | 70 | b.Property("UserId") 71 | .IsRequired(); 72 | 73 | b.HasKey("Id"); 74 | 75 | b.HasIndex("UserId"); 76 | 77 | b.ToTable("AspNetUserClaims"); 78 | }); 79 | 80 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => 81 | { 82 | b.Property("LoginProvider"); 83 | 84 | b.Property("ProviderKey"); 85 | 86 | b.Property("ProviderDisplayName"); 87 | 88 | b.Property("UserId") 89 | .IsRequired(); 90 | 91 | b.HasKey("LoginProvider", "ProviderKey"); 92 | 93 | b.HasIndex("UserId"); 94 | 95 | b.ToTable("AspNetUserLogins"); 96 | }); 97 | 98 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => 99 | { 100 | b.Property("UserId"); 101 | 102 | b.Property("RoleId"); 103 | 104 | b.HasKey("UserId", "RoleId"); 105 | 106 | b.HasIndex("RoleId"); 107 | 108 | b.HasIndex("UserId"); 109 | 110 | b.ToTable("AspNetUserRoles"); 111 | }); 112 | 113 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken", b => 114 | { 115 | b.Property("UserId"); 116 | 117 | b.Property("LoginProvider"); 118 | 119 | b.Property("Name"); 120 | 121 | b.Property("Value"); 122 | 123 | b.HasKey("UserId", "LoginProvider", "Name"); 124 | 125 | b.ToTable("AspNetUserTokens"); 126 | }); 127 | 128 | modelBuilder.Entity("GoogleAuth.Models.ApplicationUser", b => 129 | { 130 | b.Property("Id"); 131 | 132 | b.Property("AccessFailedCount"); 133 | 134 | b.Property("ConcurrencyStamp") 135 | .IsConcurrencyToken(); 136 | 137 | b.Property("Email") 138 | .HasAnnotation("MaxLength", 256); 139 | 140 | b.Property("EmailConfirmed"); 141 | 142 | b.Property("LockoutEnabled"); 143 | 144 | b.Property("LockoutEnd"); 145 | 146 | b.Property("NormalizedEmail") 147 | .HasAnnotation("MaxLength", 256); 148 | 149 | b.Property("NormalizedUserName") 150 | .HasAnnotation("MaxLength", 256); 151 | 152 | b.Property("PasswordHash"); 153 | 154 | b.Property("PhoneNumber"); 155 | 156 | b.Property("PhoneNumberConfirmed"); 157 | 158 | b.Property("SecurityStamp"); 159 | 160 | b.Property("TwoFactorEnabled"); 161 | 162 | b.Property("UserName") 163 | .HasAnnotation("MaxLength", 256); 164 | 165 | b.HasKey("Id"); 166 | 167 | b.HasIndex("NormalizedEmail") 168 | .HasName("EmailIndex"); 169 | 170 | b.HasIndex("NormalizedUserName") 171 | .IsUnique() 172 | .HasName("UserNameIndex"); 173 | 174 | b.ToTable("AspNetUsers"); 175 | }); 176 | 177 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => 178 | { 179 | b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") 180 | .WithMany("Claims") 181 | .HasForeignKey("RoleId") 182 | .OnDelete(DeleteBehavior.Cascade); 183 | }); 184 | 185 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => 186 | { 187 | b.HasOne("GoogleAuth.Models.ApplicationUser") 188 | .WithMany("Claims") 189 | .HasForeignKey("UserId") 190 | .OnDelete(DeleteBehavior.Cascade); 191 | }); 192 | 193 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => 194 | { 195 | b.HasOne("GoogleAuth.Models.ApplicationUser") 196 | .WithMany("Logins") 197 | .HasForeignKey("UserId") 198 | .OnDelete(DeleteBehavior.Cascade); 199 | }); 200 | 201 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => 202 | { 203 | b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") 204 | .WithMany("Users") 205 | .HasForeignKey("RoleId") 206 | .OnDelete(DeleteBehavior.Cascade); 207 | 208 | b.HasOne("GoogleAuth.Models.ApplicationUser") 209 | .WithMany("Roles") 210 | .HasForeignKey("UserId") 211 | .OnDelete(DeleteBehavior.Cascade); 212 | }); 213 | } 214 | } 215 | } 216 | -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/images/banner1.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GoogleAuth/obj/Release/netcoreapp2.0/PubTmp/Out/wwwroot/images/banner1.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GoogleAuth/Data/Migrations/00000000000000_CreateIdentitySchema.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.EntityFrameworkCore.Metadata; 6 | using Microsoft.EntityFrameworkCore.Migrations; 7 | 8 | namespace GoogleAuth.Data.Migrations 9 | { 10 | public partial class CreateIdentitySchema : Migration 11 | { 12 | protected override void Up(MigrationBuilder migrationBuilder) 13 | { 14 | migrationBuilder.CreateTable( 15 | name: "AspNetRoles", 16 | columns: table => new 17 | { 18 | Id = table.Column(nullable: false), 19 | ConcurrencyStamp = table.Column(nullable: true), 20 | Name = table.Column(maxLength: 256, nullable: true), 21 | NormalizedName = table.Column(maxLength: 256, nullable: true) 22 | }, 23 | constraints: table => 24 | { 25 | table.PrimaryKey("PK_AspNetRoles", x => x.Id); 26 | }); 27 | 28 | migrationBuilder.CreateTable( 29 | name: "AspNetUserTokens", 30 | columns: table => new 31 | { 32 | UserId = table.Column(nullable: false), 33 | LoginProvider = table.Column(nullable: false), 34 | Name = table.Column(nullable: false), 35 | Value = table.Column(nullable: true) 36 | }, 37 | constraints: table => 38 | { 39 | table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); 40 | }); 41 | 42 | migrationBuilder.CreateTable( 43 | name: "AspNetUsers", 44 | columns: table => new 45 | { 46 | Id = table.Column(nullable: false), 47 | AccessFailedCount = table.Column(nullable: false), 48 | ConcurrencyStamp = table.Column(nullable: true), 49 | Email = table.Column(maxLength: 256, nullable: true), 50 | EmailConfirmed = table.Column(nullable: false), 51 | LockoutEnabled = table.Column(nullable: false), 52 | LockoutEnd = table.Column(nullable: true), 53 | NormalizedEmail = table.Column(maxLength: 256, nullable: true), 54 | NormalizedUserName = table.Column(maxLength: 256, nullable: true), 55 | PasswordHash = table.Column(nullable: true), 56 | PhoneNumber = table.Column(nullable: true), 57 | PhoneNumberConfirmed = table.Column(nullable: false), 58 | SecurityStamp = table.Column(nullable: true), 59 | TwoFactorEnabled = table.Column(nullable: false), 60 | UserName = table.Column(maxLength: 256, nullable: true) 61 | }, 62 | constraints: table => 63 | { 64 | table.PrimaryKey("PK_AspNetUsers", x => x.Id); 65 | }); 66 | 67 | migrationBuilder.CreateTable( 68 | name: "AspNetRoleClaims", 69 | columns: table => new 70 | { 71 | Id = table.Column(nullable: false) 72 | .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), 73 | ClaimType = table.Column(nullable: true), 74 | ClaimValue = table.Column(nullable: true), 75 | RoleId = table.Column(nullable: false) 76 | }, 77 | constraints: table => 78 | { 79 | table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); 80 | table.ForeignKey( 81 | name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", 82 | column: x => x.RoleId, 83 | principalTable: "AspNetRoles", 84 | principalColumn: "Id", 85 | onDelete: ReferentialAction.Cascade); 86 | }); 87 | 88 | migrationBuilder.CreateTable( 89 | name: "AspNetUserClaims", 90 | columns: table => new 91 | { 92 | Id = table.Column(nullable: false) 93 | .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), 94 | ClaimType = table.Column(nullable: true), 95 | ClaimValue = table.Column(nullable: true), 96 | UserId = table.Column(nullable: false) 97 | }, 98 | constraints: table => 99 | { 100 | table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); 101 | table.ForeignKey( 102 | name: "FK_AspNetUserClaims_AspNetUsers_UserId", 103 | column: x => x.UserId, 104 | principalTable: "AspNetUsers", 105 | principalColumn: "Id", 106 | onDelete: ReferentialAction.Cascade); 107 | }); 108 | 109 | migrationBuilder.CreateTable( 110 | name: "AspNetUserLogins", 111 | columns: table => new 112 | { 113 | LoginProvider = table.Column(nullable: false), 114 | ProviderKey = table.Column(nullable: false), 115 | ProviderDisplayName = table.Column(nullable: true), 116 | UserId = table.Column(nullable: false) 117 | }, 118 | constraints: table => 119 | { 120 | table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); 121 | table.ForeignKey( 122 | name: "FK_AspNetUserLogins_AspNetUsers_UserId", 123 | column: x => x.UserId, 124 | principalTable: "AspNetUsers", 125 | principalColumn: "Id", 126 | onDelete: ReferentialAction.Cascade); 127 | }); 128 | 129 | migrationBuilder.CreateTable( 130 | name: "AspNetUserRoles", 131 | columns: table => new 132 | { 133 | UserId = table.Column(nullable: false), 134 | RoleId = table.Column(nullable: false) 135 | }, 136 | constraints: table => 137 | { 138 | table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); 139 | table.ForeignKey( 140 | name: "FK_AspNetUserRoles_AspNetRoles_RoleId", 141 | column: x => x.RoleId, 142 | principalTable: "AspNetRoles", 143 | principalColumn: "Id", 144 | onDelete: ReferentialAction.Cascade); 145 | table.ForeignKey( 146 | name: "FK_AspNetUserRoles_AspNetUsers_UserId", 147 | column: x => x.UserId, 148 | principalTable: "AspNetUsers", 149 | principalColumn: "Id", 150 | onDelete: ReferentialAction.Cascade); 151 | }); 152 | 153 | migrationBuilder.CreateIndex( 154 | name: "RoleNameIndex", 155 | table: "AspNetRoles", 156 | column: "NormalizedName"); 157 | 158 | migrationBuilder.CreateIndex( 159 | name: "IX_AspNetRoleClaims_RoleId", 160 | table: "AspNetRoleClaims", 161 | column: "RoleId"); 162 | 163 | migrationBuilder.CreateIndex( 164 | name: "IX_AspNetUserClaims_UserId", 165 | table: "AspNetUserClaims", 166 | column: "UserId"); 167 | 168 | migrationBuilder.CreateIndex( 169 | name: "IX_AspNetUserLogins_UserId", 170 | table: "AspNetUserLogins", 171 | column: "UserId"); 172 | 173 | migrationBuilder.CreateIndex( 174 | name: "IX_AspNetUserRoles_RoleId", 175 | table: "AspNetUserRoles", 176 | column: "RoleId"); 177 | 178 | migrationBuilder.CreateIndex( 179 | name: "IX_AspNetUserRoles_UserId", 180 | table: "AspNetUserRoles", 181 | column: "UserId"); 182 | 183 | migrationBuilder.CreateIndex( 184 | name: "EmailIndex", 185 | table: "AspNetUsers", 186 | column: "NormalizedEmail"); 187 | 188 | migrationBuilder.CreateIndex( 189 | name: "UserNameIndex", 190 | table: "AspNetUsers", 191 | column: "NormalizedUserName", 192 | unique: true); 193 | } 194 | 195 | protected override void Down(MigrationBuilder migrationBuilder) 196 | { 197 | migrationBuilder.DropTable( 198 | name: "AspNetRoleClaims"); 199 | 200 | migrationBuilder.DropTable( 201 | name: "AspNetUserClaims"); 202 | 203 | migrationBuilder.DropTable( 204 | name: "AspNetUserLogins"); 205 | 206 | migrationBuilder.DropTable( 207 | name: "AspNetUserRoles"); 208 | 209 | migrationBuilder.DropTable( 210 | name: "AspNetUserTokens"); 211 | 212 | migrationBuilder.DropTable( 213 | name: "AspNetRoles"); 214 | 215 | migrationBuilder.DropTable( 216 | name: "AspNetUsers"); 217 | } 218 | } 219 | } 220 | -------------------------------------------------------------------------------- /GoogleAuth/wwwroot/images/banner3.svg: -------------------------------------------------------------------------------- 1 | banner3b --------------------------------------------------------------------------------