You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update to .NET 6
Update the providers to .NET 6, using new language features and APIs as appropriate.
* Require VS 2022
Update the solution file to require Visual Studio 2022.
* Fix pre-release label
Use "preview" not "rc.2".
* Update Arcade
Update Arcade to the same version as used to build the v6.0.0 tag for dotnet/aspnetcore.
* Remove custom NuGet feeds
Remove custom NuGet feeds to packages for .NET 6 are sourced from NuGet.org.
Copy file name to clipboardExpand all lines: docs/discord.md
+23-2
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,27 @@ _None._
19
19
20
20
| Property Name | Property Type | Description | Default Value |
21
21
|:--|:--|:--|:--|
22
-
|`DiscordAvatarFormat`|`string`| Gets or sets the URL format string to use for user avatar images. |`DiscordAuthenticationConstants.Urls.AvatarUrlFormat`|
23
-
|`DiscordCdn`|`string`| The URL to use for the Discord CDN. |`DiscordAuthenticationConstants.Urls.DiscordCdn`|
24
22
|`Prompt`|`string?`| The value to use for the `prompt` query string parameter when making HTTP requests to the authorization endpoint. |`null`|
23
+
24
+
## Avatars as Claims
25
+
26
+
Versions of the Discord provider before version `6.0.0` would automatically map the user's avatar URL as the `urn:discord:avatar:url` claim.
27
+
28
+
This functionality is no longer built-in (see [#584](https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers/issues/584) and [#585](https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers/pull/585)), but can be added to your application with some extra code similar to that shown in the sample below.
Copy file name to clipboardExpand all lines: docs/sign-in-with-apple.md
+42-15
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ This document provides some additional information and context to help you confi
10
10
11
11
Unlike other providers, the `ClientSecret` property is not used as _Sign in with Apple_ does not use a static client secret value. Instead the client secret has to be generated using a private key file provided by Apple from the Developer Portal that is used with the Key ID and Team ID to create a signed JSON Web Token (JWT).
12
12
13
-
The provider comes with a built-in extension method ([`UsePrivateKey(string)`](https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers/blob/8e4c19008f518f3730bab90a980e01347ba6f3d3/src/AspNet.Security.OAuth.Apple/AppleAuthenticationOptionsExtensions.cs#L20-L33"UsePrivateKey() extension method")) to generate they secret from a `.p8` certificate file on disk that you provide. Here's a [code example](https://github.com/martincostello/SignInWithAppleSample/blob/245bb70a164b66ec98ea3c2040a7387b0a3e8f0e/src/SignInWithApple/Startup.cs#L37-L46"Example code to configure the Apple provider"):
13
+
The provider comes with a built-in extension method `UsePrivateKey(string)`to generate they secret from a `.p8` certificate file on disk that you provide. Here's a code example:
Alternatively you can use the [`Func<string, Task<byte[]>> PrivateKeyBytes`](https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers/blob/8e4c19008f518f3730bab90a980e01347ba6f3d3/src/AspNet.Security.OAuth.Apple/AppleAuthenticationOptions.cs#L78-L85"Definition of PrivateKeyBytes property") property of the `AppleAuthenticationOptions` class to provide a delegate to a custom method of your own that loads the private key's bytes from another location, such as Azure Key Vault, Kubernetes secrets etc.
28
+
Alternatively you can use the `Func<string, Task<ReadOnlyMemory<char>>> PrivateKey` property of the `AppleAuthenticationOptions` class to provide a delegate to a custom method of your own that loads the private key's bytes from another location, such as Azure Key Vault, Kubernetes secrets etc.
29
29
30
-
### Issues Loading Private Key
30
+
Below are two examples of this approach.
31
+
32
+
#### Loading from an Environment Variable
31
33
32
-
If you encounter issues loading the private key of the certificate, the reasons could include one of the two scenarios:
For the first scenario, before .NET Core 3.0 non-Windows platforms did not support loading `.p8` (PKCS #8) files. If you cannot use .NET Core 3.1 or later, it is recommended that you create a `.pfx` certificate file from your `.p8` file and use that instead.
68
+
### Issues Loading Private Key
40
69
41
-
Further information can be found in this GitHub issue: https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers/issues/390
70
+
If you encounter issues loading the private key of the certificate, the reasons could include one of the following scenarios.
42
71
43
72
#### Windows Server with IIS
44
73
@@ -63,7 +92,7 @@ Below are links to some issues raised against this repository that were related
63
92
64
93
## Sign in with Apple on iOS
65
94
66
-
When using _Sign In with Apple_ on an iOS 13+ Device, [Apple provides a different authentication workflow](https://developer.apple.com/documentation/authenticationservices) that returns the validation response to the app instead of in a server callback. Using that response to authenticate a user against your own backend requires sending the response to your servers and [communicating with the Apple authentication endpoint from there](https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens).
95
+
When using _Sign In with Apple_ on an iOS 13+ Device, [Apple provides a different authentication workflow](https://developer.apple.com/documentation/authenticationservices) that returns the validation response to the app instead of in a server callback. Using that response to authenticate a user against your own backend requires sending the response to your servers and [communicating with the Apple authentication endpoint from there](https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens).
67
96
68
97
This workflow is out of the scope of this package but client secret generation and token validation can provide a starting point for an ASP.NET.Core integration. Note that the `ClientId` in this case is the App Id where the authentication was requested, not your Services Id.
69
98
@@ -84,14 +113,12 @@ Below are links to a number of other documentation sources, blog posts and sampl
84
113
|:--|:--|:--|:--|
85
114
|`ClientSecretExpiresAfter`|`TimeSpan`| The period of time after which generated client secrets expire if `GenerateClientSecret` is set to `true`. | 6 months |
86
115
|`ClientSecretGenerator`|`AppleClientSecretGenerator`| A service that generates client secrets for Sign In with Apple. |_An internal implementation_|
116
+
|`ConfigurationManager`|`IConfigurationManager<OpenIdConnectConfiguration>?`| The configuration manager to use for the OpenID configuration. |`null`|
87
117
|`GenerateClientSecret`|`bool`| Whether to automatically generate a client secret. |`false`|
88
-
|`JwtSecurityTokenHandler`|`JwtSecurityTokenHandler`| The handler to use to validate JSON Web Keys. |`new JwtSecurityTokenHandler()`|
89
118
|`KeyId`|`string?`| The optional ID for your Sign in with Apple private key. |`null`|
90
-
|`KeyStore`|`AppleKeyStore`| A service that loads private keys to use with Sign In with Apple. |_An internal implementation_|
91
-
|`PublicKeyCacheLifetime`|`TimeSpan`| The default period of time to cache Apple public key(s) for. |`TimeSpan.FromMinutes(15)`|
92
-
|`PublicKeyEndpoint`|`string`| The URI to use to retrieve the Apple public keys. |`AppleAuthenticationDefaults.PublicKeyEndpoint`|
93
-
|`PrivateKeyBytes`|`Func<string, Task<byte[]>>?`| An optional delegate to use to get the raw bytes of the client's private key in PKCS #8 format. |`null`|
119
+
|`PrivateKeyBytes`|`Func<string, Task<ReadOnlyMemory<char>>>?`| An optional delegate to use to get the characters of the client's private key in PKCS #8 format. |`null`|
94
120
|`TeamId`|`string`| The Team ID for your Apple Developer account. |`""`|
95
121
|`TokenAudience`|`string`| The audience used for tokens. |`AppleAuthenticationConstants.Audience`|
96
122
|`TokenValidator`|`AppleIdTokenValidator`| A service that validates Apple ID tokens. |`An internal implementation`|
123
+
|`TokenValidationParameters`|`TokenValidationParameters`| The JSON Web Token validation parameters to use. |`new TokenValidationParameters()`|
97
124
|`ValidateTokens`|`bool`| Whether to validate tokens using Apple's public key. |`true`|
0 commit comments