14 | Disabling 2FA does not change the keys used in authenticator apps. If you wish to change the key
15 | used in an authenticator app you should reset your
16 | authenticator keys.
17 |
18 |
19 |
20 |
21 |
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 |
8 |
9 |
10 | If you reset your authenticator key your authenticator app will not work until you reconfigure it.
11 |
12 |
13 | This process disables 2FA until you verify your authenticator app and will also reset your 2FA recovery codes.
14 | If you do not complete your authenticator app configuration you may lose access to your account.
15 |
16 |
17 |
18 |
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 |
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 |
10 |
11 | This action generates new recovery codes.
12 |
13 |
14 | If you lose your device and don't have the recovery codes you will lose access to your account.
15 |
16 |
17 | Generating new recovery codes does not change the keys used in authenticator apps. If you wish to change the key
18 | used in an authenticator app you should reset your authenticator keys.
19 |
20 |
21 |
22 |
23 |
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 |
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 |
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 |
41 |
42 |
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 |
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 |
22 |
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 |
28 |
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 |
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 |