Skip to content

Conversation

@AigioL
Copy link

@AigioL AigioL commented Nov 18, 2025

improve #968

public const string Gender = "urn:alipay:gender";

/// <summary>
/// OpenID is the unique identifier of Alipay users in the application dimension.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is an "application dimension"?

public const string OpenId = "urn:alipay:open_id";

/// <summary>
/// Alipay user system internal identifier, will no longer be independently open in the future, and will be replaced by OpenID.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will no longer be independently open in the future

I don't understand what this means.

Comment on lines +56 to +57
var app_cert_sn = await Options.PrivateKey(Options.AppCertSNKeyId, Context.RequestAborted);
var alipay_root_cert_sn = await Options.PrivateKey(Options.RootCertSNKeyId, Context.RequestAborted);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camelCase.


private const string SignType = "RSA2";

private async Task AddCertSignatureParametersAsync(SortedDictionary<string, string?> parameters)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private async Task AddCertSignatureParametersAsync(SortedDictionary<string, string?> parameters)
private async Task AddCertificateSignatureParametersAsync(SortedDictionary<string, string?> parameters)

}

/// <summary>
/// Get or set a value indicating whether to use certificate mode for signature implementation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Get or set a value indicating whether to use certificate mode for signature implementation.
/// Gets or sets a value indicating whether to use certificate mode for signature implementation.

/// <summary>
/// Gets or sets the optional ID for your Sign in with alipay_root_cert_sn.
/// </summary>
public string? RootCertSNKeyId { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public string? RootCertSNKeyId { get; set; }
public string? RootCertificateSubjectNameKeyId { get; set; }

public static class AlipayAuthenticationOptionsExtensions
{
/// <summary>
/// Configures the application to use a specified private to generate a client secret for the provider.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Configures the application to use a specified private to generate a client secret for the provider.
/// Configures the application to use a specified private key to generate a client secret for the provider.

namespace AspNet.Security.OAuth.Alipay;

/// <summary>
/// https://github.com/alipay/alipay-sdk-net-all/blob/master/v2/AlipaySDKNet.Standard/Util/AntCertificationUtil.cs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update this to a permalink that points to a specific Git SHA.

/// <summary>
/// https://github.com/alipay/alipay-sdk-net-all/blob/master/v2/AlipaySDKNet.Standard/Util/AntCertificationUtil.cs
/// </summary>
internal static class AntCertificationUtil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is an Ant?

return GetCertSN(cert);
}

public static string GetCertSN(X509Certificate2 cert)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this code need to be this performance critical (e.g. with stackalloc)? Feels like it could be implemented more simply to make it easier to read and maintain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants