src/AspNet.Security.OAuth.Apple/AppleAuthenticationOptionsExtensions.cs
/// <summary>
/// Configures the application to use a specified private to generate a client secret for the provider.
/// </summary>
/// <param name="options">The Apple authentication options to configure.</param>
/// <param name="privateKeyFile">
/// A delegate to a method to return the <see cref="IFileInfo"/> for the private
/// key which is passed the value of <see cref="AppleAuthenticationOptions.KeyId"/>.
/// </param>
/// <returns>
/// The value of the <paramref name="options"/> argument.
/// </returns>
Configures the application to use a specified private to generate a client secret for the provider.
Configures the application to use a specified private to generate a client secret for the provider .
public static AppleAuthenticationOptions UsePrivateKey(
        [NotNull] this AppleAuthenticationOptions options,
        [NotNull] Func<string, IFileInfo> privateKeyFile)
    {
        options.GenerateClientSecret = true;
        options.PrivateKey = async (keyId, _) =>
        {
            var fileInfo = privateKeyFile(keyId);
            using var stream = fileInfo.CreateReadStream();
            using var reader = new StreamReader(stream);
            return (await reader.ReadToEndAsync()).AsMemory();
        };
        return options;
    }
public static AppleAuthenticationOptions UsePrivateKey ( [ NotNull ] this AppleAuthenticationOptions options , [ NotNull ] Func < string , IFileInfo > privateKeyFile ) { options . GenerateClientSecret = true ; options . PrivateKey = async ( keyId , _ ) => { var fileInfo = privateKeyFile ( keyId ) ; using var stream = fileInfo . CreateReadStream ( ) ; using var reader = new StreamReader ( stream ) ; return ( await reader . ReadToEndAsync ( ) ) . AsMemory ( ) ; } ; return options ; }
Configures the application to use a specified private to generate a client secret for the provider.
Configures the application to use a specified private to generate a client secret for the provider .
The value of the  argument.
The value of the argument .
this
[NotNull]
Func<string, IFileInfo>
[NotNull]
options
The Apple authentication options to configure.
The Apple authentication options to configure .
privateKeyFile
A delegate to a method to return the  for the private
key which is passed the value of .
A delegate to a method to return the for the private key which is passed the value of .