-
Notifications
You must be signed in to change notification settings - Fork 550
Add support for Alipay certificate signing #1131
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
base: dev
Are you sure you want to change the base?
Conversation
| public const string Gender = "urn:alipay:gender"; | ||
|
|
||
| /// <summary> | ||
| /// OpenID is the unique identifier of Alipay users in the application dimension. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
| var app_cert_sn = await Options.PrivateKey(Options.AppCertSNKeyId, Context.RequestAborted); | ||
| var alipay_root_cert_sn = await Options.PrivateKey(Options.RootCertSNKeyId, Context.RequestAborted); |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// 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; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
improve #968