Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cffa395
Basic Apple provider
martincostello Jun 6, 2019
5c3d7cd
Implement Apple provider
martincostello Jun 8, 2019
f78fa43
Enable Sign In with Apple
martincostello Jun 8, 2019
7ba0afb
Update tests
martincostello Jun 8, 2019
7a24782
Enable token lifetime validation
martincostello Jun 8, 2019
c0fc31c
Add null annotations
martincostello Jun 9, 2019
cd8ed33
Improve exception handling
martincostello Jun 9, 2019
9bc3817
Extend integration tests
martincostello Jun 9, 2019
404730e
Move expiry period to options
martincostello Jun 9, 2019
8b11fe7
Add ClientSecretExpiresAfter validation
martincostello Jun 9, 2019
c7b2f74
Add tests for options validation
martincostello Jun 9, 2019
05a8102
Add unit tests for client secret
martincostello Jun 9, 2019
9948d08
Make KeyId required
martincostello Jun 9, 2019
5e72f38
Fix test
martincostello Jun 9, 2019
2d4794a
Fix Linux and macOS secret generation
martincostello Jun 9, 2019
13012dd
Add password option for pfx files
martincostello Jun 9, 2019
b9f329a
Fix flaky test
martincostello Jun 9, 2019
210fbf9
Add UsePrivateKey() method
martincostello Jun 9, 2019
94f1737
Bump System.IdentityModel.Tokens.Jwt
martincostello Jun 9, 2019
67dc9a3
Set response_mode to form_post
martincostello Sep 8, 2019
eae3d43
Use latest C# version
martincostello Sep 8, 2019
4a93eb6
Retrieve user details after sign-in
martincostello Sep 8, 2019
74f607a
Update branding
martincostello Sep 15, 2019
dbbf2db
Access events via options
martincostello Sep 15, 2019
785a01a
Resolve logging TODO
martincostello Sep 15, 2019
eb5ccfd
Comment out Apple option
martincostello Sep 20, 2019
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
Prev Previous commit
Next Next commit
Move expiry period to options
Move the configured lifetime for generated client secrets to the options class.
  • Loading branch information
martincostello committed Sep 8, 2019
commit 404730eb9714a9ae406097a116fc5aa6b4cad44c
9 changes: 9 additions & 0 deletions src/AspNet.Security.OAuth.Apple/AppleAuthenticationOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ public AppleAuthenticationOptions()
Scope.Add("email");
}

/// <summary>
/// Gets or sets the period of time after which generated client secrets expire
/// if <see cref="GenerateClientSecret"/> is set to <see langword="true"/>.
/// </summary>
/// <remarks>
/// The default client secret lifetime is six months.
/// </remarks>
public TimeSpan ClientSecretExpiresAfter { get; set; } = TimeSpan.FromSeconds(15777000); // 6 months in seconds

/// <summary>
/// Gets or sets the <see cref="AppleAuthenticationEvents"/> used to handle authentication events.
/// </summary>
Expand Down
9 changes: 0 additions & 9 deletions src/AspNet.Security.OAuth.Apple/AppleClientSecretGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* for more information concerning the license and the contributors participating to this project.
*/

using System;
using System.Threading.Tasks;

namespace AspNet.Security.OAuth.Apple
Expand All @@ -14,14 +13,6 @@ namespace AspNet.Security.OAuth.Apple
/// </summary>
public abstract class AppleClientSecretGenerator
{
/// <summary>
/// Gets or sets the period of time after which generated client secrets expire.
/// </summary>
/// <remarks>
/// The default client secret lifetime is six months.
/// </remarks>
public TimeSpan ExpiresAfter { get; set; } = TimeSpan.FromSeconds(15777000); // 6 months in seconds

/// <summary>
/// Generates a client secret for Sign In with Apple as an asynchronous operation.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public override async Task<string> GenerateAsync([NotNull] AppleGenerateClientSe
private async Task<(string clientSecret, DateTimeOffset expiresAt)> GenerateNewSecretAsync(
[NotNull] AppleGenerateClientSecretContext context)
{
var expiresAt = _clock.UtcNow.Add(ExpiresAfter).UtcDateTime;
var expiresAt = _clock.UtcNow.Add(context.Options.ClientSecretExpiresAfter).UtcDateTime;
var subject = new Claim("sub", context.Options.ClientId);

_logger.LogDebug(
Expand Down