Skip to content

Add more MapIdentityApi endpoints #49498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Http/Routing/src/EndpointNameMetadata.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Diagnostics;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Shared;

Expand All @@ -13,6 +14,7 @@ namespace Microsoft.AspNetCore.Routing;
/// Endpoint names must be unique within an application, and can be used to unambiguously
/// identify a desired endpoint for URI generation using <see cref="LinkGenerator"/>.
/// </remarks>
[DebuggerDisplay("{ToString(),nq}")]
public class EndpointNameMetadata : IEndpointNameMetadata
{
/// <summary>
Expand Down
13 changes: 13 additions & 0 deletions src/Identity/Core/src/DTO/AuthenticatorKeyResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Identity.DTO;

internal sealed class TwoFactorResponse
{
public required string SharedKey { get; init; }
public required int RecoveryCodesLeft { get; init; }
public string[]? RecoveryCodes { get; init; }
public required bool IsTwoFactorEnabled { get; init; }
public required bool IsMachineRemembered { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ namespace Microsoft.AspNetCore.Identity.DTO;

[JsonSerializable(typeof(RegisterRequest))]
[JsonSerializable(typeof(LoginRequest))]
[JsonSerializable(typeof(RefreshRequest))]
[JsonSerializable(typeof(ResetPasswordRequest))]
[JsonSerializable(typeof(ResendEmailRequest))]
[JsonSerializable(typeof(InfoRequest))]
[JsonSerializable(typeof(InfoResponse))]
[JsonSerializable(typeof(TwoFactorRequest))]
[JsonSerializable(typeof(TwoFactorResponse))]
internal sealed partial class IdentityEndpointsJsonSerializerContext : JsonSerializerContext
{
}
12 changes: 12 additions & 0 deletions src/Identity/Core/src/DTO/InfoRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Identity.DTO;

internal sealed class InfoRequest
{
public string? NewUsername { get; init; }
public string? NewEmail { get; init; }
public string? NewPassword { get; init; }
public string? OldPassword { get; init; }
}
11 changes: 11 additions & 0 deletions src/Identity/Core/src/DTO/InfoResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Identity.DTO;

internal sealed class InfoResponse
{
public required string Username { get; init; }
public required string Email { get; init; }
public required IDictionary<string, string> Claims { get; init; }
}
2 changes: 2 additions & 0 deletions src/Identity/Core/src/DTO/LoginRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ internal sealed class LoginRequest
{
public required string Username { get; init; }
public required string Password { get; init; }
public string? TwoFactorCode { get; init; }
public string? TwoFactorRecoveryCode { get; init; }
}
1 change: 1 addition & 0 deletions src/Identity/Core/src/DTO/RegisterRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ internal sealed class RegisterRequest
{
public required string Username { get; init; }
public required string Password { get; init; }
public required string Email { get; init; }
}
9 changes: 9 additions & 0 deletions src/Identity/Core/src/DTO/ResendEmailRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Identity.DTO;

internal sealed class ResendEmailRequest
{
public required string Email { get; init; }
}
11 changes: 11 additions & 0 deletions src/Identity/Core/src/DTO/ResetPasswordRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Identity.DTO;

internal sealed class ResetPasswordRequest
{
public required string Email { get; init; }
public string? ResetCode { get; init; }
public string? NewPassword { get; init; }
}
14 changes: 14 additions & 0 deletions src/Identity/Core/src/DTO/TwoFactorRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Identity.DTO;

internal sealed class TwoFactorRequest
{
public bool? Enable { get; init; }
public string? TwoFactorCode { get; init; }

public bool ResetSharedKey { get; init; }
public bool ResetRecoveryCodes { get; init; }
public bool ForgetMachine { get; init; }
}
Loading