687 changed files with 13678 additions and 498 deletions
@ -1,26 +0,0 @@ |
|||
using Microsoft.AspNetCore.Authentication; |
|||
using Microsoft.AspNetCore.Authentication.Cookies; |
|||
using Microsoft.AspNetCore.Authentication.OpenIdConnect; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
|
|||
namespace Mvc.Client.Controllers; |
|||
|
|||
public class AuthenticationController : Controller |
|||
{ |
|||
[HttpGet("~/login")] |
|||
public ActionResult LogIn() |
|||
{ |
|||
// Instruct the OIDC client middleware to redirect the user agent to the identity provider.
|
|||
// Note: the authenticationType parameter must match the value configured in Startup.cs
|
|||
return Challenge(new AuthenticationProperties { RedirectUri = "/" }, OpenIdConnectDefaults.AuthenticationScheme); |
|||
} |
|||
|
|||
[HttpGet("~/logout"), HttpPost("~/logout")] |
|||
public ActionResult LogOut() |
|||
{ |
|||
// Instruct the cookies middleware to delete the local cookie created when the user agent
|
|||
// is redirected from the identity provider after a successful authorization flow and
|
|||
// to redirect the user agent to the identity provider to sign out.
|
|||
return SignOut(CookieAuthenticationDefaults.AuthenticationScheme, OpenIdConnectDefaults.AuthenticationScheme); |
|||
} |
|||
} |
|||
@ -1,79 +0,0 @@ |
|||
using Microsoft.AspNetCore.Authentication.Cookies; |
|||
using Microsoft.AspNetCore.Authentication.OpenIdConnect; |
|||
using Microsoft.IdentityModel.Protocols.OpenIdConnect; |
|||
|
|||
namespace Mvc.Client; |
|||
|
|||
public class Startup |
|||
{ |
|||
public void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddAuthentication(options => |
|||
{ |
|||
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; |
|||
}) |
|||
|
|||
.AddCookie(options => |
|||
{ |
|||
options.LoginPath = "/login"; |
|||
options.ExpireTimeSpan = TimeSpan.FromMinutes(50); |
|||
options.SlidingExpiration = false; |
|||
}) |
|||
|
|||
.AddOpenIdConnect(options => |
|||
{ |
|||
// Note: these settings must match the application details
|
|||
// inserted in the database at the server level.
|
|||
options.ClientId = "mvc"; |
|||
options.ClientSecret = "901564A5-E7FE-42CB-B10D-61EF6A8F3654"; |
|||
|
|||
options.RequireHttpsMetadata = false; |
|||
options.GetClaimsFromUserInfoEndpoint = true; |
|||
options.SaveTokens = true; |
|||
|
|||
// Use the authorization code flow.
|
|||
options.ResponseType = OpenIdConnectResponseType.Code; |
|||
options.AuthenticationMethod = OpenIdConnectRedirectBehavior.RedirectGet; |
|||
|
|||
// Note: setting the Authority allows the OIDC client middleware to automatically
|
|||
// retrieve the identity provider's configuration and spare you from setting
|
|||
// the different endpoints URIs or the token validation parameters explicitly.
|
|||
options.Authority = "https://localhost:44395/"; |
|||
|
|||
options.Scope.Add("email"); |
|||
options.Scope.Add("roles"); |
|||
options.Scope.Add("offline_access"); |
|||
options.Scope.Add("demo_api"); |
|||
|
|||
// Disable the built-in JWT claims mapping feature.
|
|||
options.MapInboundClaims = false; |
|||
|
|||
options.TokenValidationParameters.NameClaimType = "name"; |
|||
options.TokenValidationParameters.RoleClaimType = "role"; |
|||
|
|||
options.AccessDeniedPath = "/"; |
|||
}); |
|||
|
|||
services.AddHttpClient(); |
|||
|
|||
services.AddControllersWithViews(); |
|||
} |
|||
|
|||
public void Configure(IApplicationBuilder app) |
|||
{ |
|||
app.UseDeveloperExceptionPage(); |
|||
|
|||
app.UseStaticFiles(); |
|||
|
|||
app.UseRouting(); |
|||
|
|||
app.UseAuthentication(); |
|||
app.UseAuthorization(); |
|||
|
|||
app.UseEndpoints(options => |
|||
{ |
|||
options.MapControllers(); |
|||
options.MapDefaultControllerRoute(); |
|||
}); |
|||
} |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
@using Mvc.Server |
|||
@using Mvc.Server.Models |
|||
@using Mvc.Server.ViewModels.Account |
|||
@using Mvc.Server.ViewModels.Authorization |
|||
@using Mvc.Server.ViewModels.Manage |
|||
@using Mvc.Server.ViewModels.Shared |
|||
@using Microsoft.AspNetCore.Identity |
|||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers |
|||
@ -0,0 +1,139 @@ |
|||
using System.Security.Claims; |
|||
using Microsoft.AspNetCore.Authentication; |
|||
using Microsoft.AspNetCore.Authentication.Cookies; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using OpenIddict.Client.AspNetCore; |
|||
using static OpenIddict.Abstractions.OpenIddictConstants; |
|||
|
|||
namespace OpenIddict.Sandbox.AspNetCore.Client.Controllers; |
|||
|
|||
public class AuthenticationController : Controller |
|||
{ |
|||
[HttpGet("~/login")] |
|||
public ActionResult LogIn(string returnUrl) |
|||
{ |
|||
var properties = new AuthenticationProperties(new Dictionary<string, string> |
|||
{ |
|||
// Note: when only one client is registered in the client options,
|
|||
// setting the issuer property is not required and can be omitted.
|
|||
[OpenIddictClientAspNetCoreConstants.Properties.Issuer] = "https://localhost:44395/" |
|||
}) |
|||
{ |
|||
// Only allow local return URLs to prevent open redirect attacks.
|
|||
RedirectUri = Url.IsLocalUrl(returnUrl) ? returnUrl : "/" |
|||
}; |
|||
|
|||
// Ask the OpenIddict client middleware to redirect the user agent to the identity provider.
|
|||
return Challenge(properties, OpenIddictClientAspNetCoreDefaults.AuthenticationScheme); |
|||
} |
|||
|
|||
[HttpGet("~/signin-oidc"), HttpPost("~/signin-oidc")] |
|||
public async Task<ActionResult> Callback() |
|||
{ |
|||
// Retrieve the authorization data validated by OpenIddict as part of the callback handling.
|
|||
var result = await HttpContext.AuthenticateAsync(OpenIddictClientAspNetCoreDefaults.AuthenticationScheme); |
|||
|
|||
// Multiple strategies exist to handle OAuth 2.0/OpenID Connect callbacks, each with their pros and cons:
|
|||
//
|
|||
// * Directly using the tokens to perform the necessary action(s) on behalf of the user, which is suitable
|
|||
// for applications that don't need a long-term access to the user's resources or don't want to store
|
|||
// access/refresh tokens in a database or in an authentication cookie (which has security implications).
|
|||
// It is also suitable for applications that don't need to authenticate users but only need to perform
|
|||
// action(s) on their behalf by making API calls using the access tokens returned by the remote server.
|
|||
//
|
|||
// * Storing the external claims/tokens in a database (and optionally keeping the essentials claims in an
|
|||
// authentication cookie so that cookie size limits are not hit). For the applications that use ASP.NET
|
|||
// Core Identity, the UserManager.SetAuthenticationTokenAsync() API can be used to store external tokens.
|
|||
//
|
|||
// Note: in this case, it's recommended to use column encryption to protect the tokens in the database.
|
|||
//
|
|||
// * Storing the external claims/tokens in an authentication cookie, which doesn't require having
|
|||
// a user database but may be affected by the cookie size limits enforced by most browser vendors
|
|||
// (e.g Safari for macOS and Safari for iOS/iPadOS enforce a per-domain 4KB limit for all cookies).
|
|||
//
|
|||
// Note: this is the approach used here, but the external claims are first filtered to only persist
|
|||
// a few claims like the user identifier. The same approach is used to store the access/refresh tokens.
|
|||
|
|||
// Important: if the remote server doesn't support OpenID Connect and doesn't expose a userinfo endpoint,
|
|||
// result.Principal.Identity will represent an unauthenticated identity and won't contain any claim.
|
|||
//
|
|||
// Such identities cannot be used as-is to build an authentication cookie in ASP.NET Core (as the
|
|||
// antiforgery stack requires at least a name claim to bind CSRF cookies to the user's identity) but
|
|||
// the access/refresh tokens can be retrieved using result.Properties.GetTokens() to make API calls.
|
|||
if (result.Principal.Identity is not ClaimsIdentity { IsAuthenticated: true }) |
|||
{ |
|||
throw new InvalidOperationException("The external authorization data cannot be used for authentication."); |
|||
} |
|||
|
|||
// Build an identity based on the external claims and that will be used to create the authentication cookie.
|
|||
//
|
|||
// By default, all claims extracted during the authorization dance are available. The claims collection stored
|
|||
// in the cookie can be filtered out or mapped to different names depending the claim name or its issuer.
|
|||
var claims = result.Principal.Claims |
|||
.Select(claim => claim switch |
|||
{ |
|||
// Applications can map non-standard claims issued by specific issuers to a standard equivalent.
|
|||
{ Type: "non_standard_user_id", Issuer: "https://example.com/" } |
|||
=> new Claim(Claims.Subject, claim.Value, claim.ValueType, claim.Issuer), |
|||
|
|||
_ => claim |
|||
}) |
|||
.Where(claim => claim switch |
|||
{ |
|||
// Preserve the "name" and "sub" claims.
|
|||
{ Type: Claims.Name or Claims.Subject } => true, |
|||
|
|||
// Applications that use multiple client registrations can filter claims based on the issuer.
|
|||
{ Type: "custom_claim", Issuer: "https://example.com/" } => true, |
|||
|
|||
// Don't preserve the other claims.
|
|||
_ => false |
|||
}); |
|||
|
|||
var identity = new ClaimsIdentity(claims, |
|||
authenticationType: CookieAuthenticationDefaults.AuthenticationScheme, |
|||
nameType: Claims.Name, |
|||
roleType: Claims.Role); |
|||
|
|||
// If needed, the tokens returned by the authorization server can be stored in the authentication cookie.
|
|||
// To make cookies less heavy, tokens that are not used can be filtered out before creating the cookie.
|
|||
var tokens = result.Properties.GetTokens().Where(token => token switch |
|||
{ |
|||
// Preserve the access and refresh tokens returned in the token response, if available.
|
|||
{ |
|||
Name: OpenIddictClientAspNetCoreConstants.Tokens.BackchannelAccessToken or |
|||
OpenIddictClientAspNetCoreConstants.Tokens.BackchannelRefreshToken |
|||
} => true, |
|||
|
|||
// Ignore the other tokens.
|
|||
_ => false |
|||
}); |
|||
|
|||
var properties = new AuthenticationProperties |
|||
{ |
|||
RedirectUri = result.Properties.RedirectUri |
|||
}; |
|||
|
|||
properties.StoreTokens(tokens); |
|||
|
|||
// Note: "return SignIn(...)" cannot be directly used in this case, as the cookies handler doesn't allow
|
|||
// redirecting from an endpoint that doesn't match the path set in CookieAuthenticationOptions.LoginPath.
|
|||
// For more information about this restriction, visit https://github.com/dotnet/aspnetcore/issues/36934.
|
|||
await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(identity), properties); |
|||
|
|||
return Redirect(properties.RedirectUri ?? "/"); |
|||
} |
|||
|
|||
[HttpGet("~/logout"), HttpPost("~/logout")] |
|||
public ActionResult LogOut() |
|||
{ |
|||
// Ask the cookies middleware to delete the local cookie created when the user agent
|
|||
// is redirected from the identity provider after a successful authorization flow.
|
|||
var properties = new AuthenticationProperties |
|||
{ |
|||
RedirectUri = "/" |
|||
}; |
|||
|
|||
return SignOut(properties, CookieAuthenticationDefaults.AuthenticationScheme); |
|||
} |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
/* |
|||
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
|
|||
* See https://github.com/openiddict/openiddict-core for more information concerning
|
|||
* the license and the contributors participating to this project. |
|||
*/ |
|||
|
|||
using Microsoft.AspNetCore; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using OpenIddict.Sandbox.AspNetCore.Client.ViewModels.Shared; |
|||
|
|||
namespace OpenIddict.Sandbox.AspNetCore.Client; |
|||
|
|||
public class ErrorController : Controller |
|||
{ |
|||
[HttpGet, HttpPost, Route("~/error")] |
|||
public IActionResult Error() |
|||
{ |
|||
// If the error was not caused by an invalid
|
|||
// OIDC request, display a generic error page.
|
|||
var response = HttpContext.GetOpenIddictClientResponse(); |
|||
if (response is null) |
|||
{ |
|||
return View(new ErrorViewModel()); |
|||
} |
|||
|
|||
return View(new ErrorViewModel |
|||
{ |
|||
Error = response.Error, |
|||
ErrorDescription = response.ErrorDescription |
|||
}); |
|||
} |
|||
} |
|||
@ -1,4 +1,4 @@ |
|||
namespace Mvc.Server; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Client; |
|||
|
|||
public static class Program |
|||
{ |
|||
@ -0,0 +1,80 @@ |
|||
using Microsoft.AspNetCore.Authentication.Cookies; |
|||
using OpenIddict.Abstractions; |
|||
using OpenIddict.Client; |
|||
using static OpenIddict.Abstractions.OpenIddictConstants; |
|||
|
|||
namespace OpenIddict.Sandbox.AspNetCore.Client; |
|||
|
|||
public class Startup |
|||
{ |
|||
public void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddAuthentication(options => |
|||
{ |
|||
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; |
|||
}) |
|||
|
|||
.AddCookie(options => |
|||
{ |
|||
options.LoginPath = "/login"; |
|||
options.LogoutPath = "/logout"; |
|||
options.ExpireTimeSpan = TimeSpan.FromMinutes(50); |
|||
options.SlidingExpiration = false; |
|||
}); |
|||
|
|||
services.AddOpenIddict() |
|||
.AddClient(options => |
|||
{ |
|||
// Add a client registration matching the client application definition in the server project.
|
|||
options.AddRegistration(new OpenIddictClientRegistration |
|||
{ |
|||
Issuer = new Uri("https://localhost:44395/", UriKind.Absolute), |
|||
|
|||
ClientId = "mvc", |
|||
ClientSecret = "901564A5-E7FE-42CB-B10D-61EF6A8F3654", |
|||
RedirectUri = new Uri("https://localhost:44381/signin-oidc", UriKind.Absolute), |
|||
Scopes = { Scopes.Email, Scopes.Profile, Scopes.OfflineAccess, "demo_api" } |
|||
}); |
|||
|
|||
// Enable the redirection endpoint needed to handle the callback stage.
|
|||
options.SetRedirectionEndpointUris(new Uri("/signin-oidc", UriKind.Relative)); |
|||
|
|||
// Register the ASP.NET Core host and configure the ASP.NET Core-specific options.
|
|||
options.UseAspNetCore() |
|||
.EnableStatusCodePagesIntegration() |
|||
.EnableRedirectionEndpointPassthrough(); |
|||
|
|||
// Register the signing and encryption credentials used to protect
|
|||
// sensitive data like the state tokens produced by OpenIddict.
|
|||
options.AddDevelopmentEncryptionCertificate() |
|||
.AddDevelopmentSigningCertificate(); |
|||
|
|||
// Register the System.Net.Http integration.
|
|||
options.UseSystemNetHttp(); |
|||
}); |
|||
|
|||
services.AddHttpClient(); |
|||
|
|||
services.AddControllersWithViews(); |
|||
} |
|||
|
|||
public void Configure(IApplicationBuilder app) |
|||
{ |
|||
app.UseDeveloperExceptionPage(); |
|||
|
|||
app.UseStaticFiles(); |
|||
|
|||
app.UseStatusCodePagesWithReExecute("/error"); |
|||
|
|||
app.UseRouting(); |
|||
|
|||
app.UseAuthentication(); |
|||
app.UseAuthorization(); |
|||
|
|||
app.UseEndpoints(options => |
|||
{ |
|||
options.MapControllers(); |
|||
options.MapDefaultControllerRoute(); |
|||
}); |
|||
} |
|||
} |
|||
@ -1,6 +1,6 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Mvc.Server.ViewModels.Shared; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Client.ViewModels.Shared; |
|||
|
|||
public class ErrorViewModel |
|||
{ |
|||
@ -0,0 +1,3 @@ |
|||
@using OpenIddict.Sandbox.AspNetCore.Client |
|||
@using OpenIddict.Sandbox.AspNetCore.Client.ViewModels.Shared |
|||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers |
|||
@ -0,0 +1,24 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<configuration> |
|||
|
|||
<!-- To customize the asp.net core module uncomment and edit the following section. |
|||
For more info see https://go.microsoft.com/fwlink/?linkid=838655 --> |
|||
<!-- |
|||
<system.webServer> |
|||
<handlers> |
|||
<remove name="aspNetCore"/> |
|||
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/> |
|||
</handlers> |
|||
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" /> |
|||
</system.webServer> |
|||
--> |
|||
|
|||
<system.webServer> |
|||
<security> |
|||
<requestFiltering> |
|||
<requestLimits maxQueryString="32768"/> |
|||
</requestFiltering> |
|||
</security> |
|||
</system.webServer> |
|||
|
|||
</configuration> |
|||
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
@ -1,6 +1,6 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
|
|||
namespace Mvc.Server.Controllers; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.Controllers; |
|||
|
|||
public class HomeController : Controller |
|||
{ |
|||
@ -1,11 +1,11 @@ |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Identity; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Mvc.Server.Models; |
|||
using Mvc.Server.Services; |
|||
using Mvc.Server.ViewModels.Manage; |
|||
using OpenIddict.Sandbox.AspNetCore.Server.Models; |
|||
using OpenIddict.Sandbox.AspNetCore.Server.Services; |
|||
using OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Manage; |
|||
|
|||
namespace Mvc.Server.Controllers; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.Controllers; |
|||
|
|||
[Authorize] |
|||
public class ManageController : Controller |
|||
@ -1,4 +1,4 @@ |
|||
namespace Mvc.Server.Helpers; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.Helpers; |
|||
|
|||
public static class AsyncEnumerableExtensions |
|||
{ |
|||
@ -1,7 +1,7 @@ |
|||
using Microsoft.AspNetCore.Mvc.Abstractions; |
|||
using Microsoft.AspNetCore.Mvc.ActionConstraints; |
|||
|
|||
namespace Mvc.Server.Helpers; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.Helpers; |
|||
|
|||
public sealed class FormValueRequiredAttribute : ActionMethodSelectorAttribute |
|||
{ |
|||
@ -1,7 +1,7 @@ |
|||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
|
|||
namespace Mvc.Server.Models; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.Models; |
|||
|
|||
public class ApplicationDbContext : IdentityDbContext<ApplicationUser> |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using Microsoft.AspNetCore.Identity; |
|||
|
|||
namespace Mvc.Server.Models; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.Models; |
|||
|
|||
// Add profile data for application users by adding properties to the ApplicationUser class
|
|||
public class ApplicationUser : IdentityUser { } |
|||
@ -1,4 +1,4 @@ |
|||
namespace Mvc.Client; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server; |
|||
|
|||
public static class Program |
|||
{ |
|||
@ -1,4 +1,4 @@ |
|||
namespace Mvc.Server.Services; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.Services; |
|||
|
|||
public interface IEmailSender |
|||
{ |
|||
@ -1,4 +1,4 @@ |
|||
namespace Mvc.Server.Services; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.Services; |
|||
|
|||
public interface ISmsSender |
|||
{ |
|||
@ -1,4 +1,4 @@ |
|||
namespace Mvc.Server.Services; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.Services; |
|||
|
|||
// This class is used by the application to send Email and SMS
|
|||
// when you turn on two-factor authentication in ASP.NET Identity.
|
|||
@ -1,11 +1,11 @@ |
|||
using Microsoft.AspNetCore.Identity; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Mvc.Server.Models; |
|||
using Mvc.Server.Services; |
|||
using OpenIddict.Sandbox.AspNetCore.Server.Models; |
|||
using OpenIddict.Sandbox.AspNetCore.Server.Services; |
|||
using Quartz; |
|||
using static OpenIddict.Abstractions.OpenIddictConstants; |
|||
|
|||
namespace Mvc.Server; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server; |
|||
|
|||
public class Startup |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Mvc.Server.ViewModels.Account; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Account; |
|||
|
|||
public class ExternalLoginConfirmationViewModel |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Mvc.Server.ViewModels.Account; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Account; |
|||
|
|||
public class ForgotPasswordViewModel |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Mvc.Server.ViewModels.Account; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Account; |
|||
|
|||
public class LoginViewModel |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Mvc.Server.ViewModels.Account; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Account; |
|||
|
|||
public class RegisterViewModel |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Mvc.Server.ViewModels.Account; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Account; |
|||
|
|||
public class ResetPasswordViewModel |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using Microsoft.AspNetCore.Mvc.Rendering; |
|||
|
|||
namespace Mvc.Server.ViewModels.Account; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Account; |
|||
|
|||
public class SendCodeViewModel |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Mvc.Server.ViewModels.Account; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Account; |
|||
|
|||
public class VerifyCodeViewModel |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Mvc.Server.ViewModels.Authorization; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Authorization; |
|||
|
|||
public class AuthorizeViewModel |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Mvc.Server.ViewModels.Manage; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Manage; |
|||
|
|||
public class AddPhoneNumberViewModel |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Mvc.Server.ViewModels.Manage; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Manage; |
|||
|
|||
public class ChangePasswordViewModel |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using Microsoft.AspNetCore.Mvc.Rendering; |
|||
|
|||
namespace Mvc.Server.ViewModels.Manage; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Manage; |
|||
|
|||
public class ConfigureTwoFactorViewModel |
|||
{ |
|||
@ -1,4 +1,4 @@ |
|||
namespace Mvc.Server.ViewModels.Manage; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Manage; |
|||
|
|||
public class FactorViewModel |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using Microsoft.AspNetCore.Identity; |
|||
|
|||
namespace Mvc.Server.ViewModels.Manage; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Manage; |
|||
|
|||
public class IndexViewModel |
|||
{ |
|||
@ -1,7 +1,7 @@ |
|||
using Microsoft.AspNetCore.Authentication; |
|||
using Microsoft.AspNetCore.Identity; |
|||
|
|||
namespace Mvc.Server.ViewModels.Manage; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Manage; |
|||
|
|||
public class ManageLoginsViewModel |
|||
{ |
|||
@ -1,4 +1,4 @@ |
|||
namespace Mvc.Server.ViewModels.Manage; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Manage; |
|||
|
|||
public class RemoveLoginViewModel |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Mvc.Server.ViewModels.Manage; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Manage; |
|||
|
|||
public class SetPasswordViewModel |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Mvc.Server.ViewModels.Manage; |
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Manage; |
|||
|
|||
public class VerifyPhoneNumberViewModel |
|||
{ |
|||
@ -0,0 +1,12 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace OpenIddict.Sandbox.AspNetCore.Server.ViewModels.Shared; |
|||
|
|||
public class ErrorViewModel |
|||
{ |
|||
[Display(Name = "Error")] |
|||
public string Error { get; set; } |
|||
|
|||
[Display(Name = "Description")] |
|||
public string ErrorDescription { get; set; } |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue