private static async Task <AppleAuthClient> CreateAppleClient(string p8Path) { var p8 = await File.ReadAllTextAsync(p8Path); var authSetting = new AppleAuthSetting(_settings.TeamId, _settings.ClientId, _settings.RedirectUri); var keySetting = new AppleKeySetting(_settings.KeyId, p8); return(new AppleAuthClient(authSetting, keySetting)); }
/// <summary> /// Initializes a new instance of the <see cref="AppleTokenGenerator"/> class. /// </summary> /// <param name="authSetting">Your subscription identifier present in the membership section in your apple developer account</param> /// <param name="appleKeySetting">Informations of the key created for the "Sign in with Apple" feature</param> /// <param name="httpClient"></param> public AppleAuthClient(AppleAuthSetting authSetting, AppleKeySetting appleKeySetting, HttpClient httpClient) : this(authSetting, new AppleTokenGenerator(authSetting.TeamId, authSetting.ClientId, appleKeySetting), httpClient) { }
/// <summary> /// Initializes a new instance of the <see cref="AppleTokenGenerator"/> class. /// </summary> /// <param name="teamId">Your subscription identifier present in the membership section in your apple developer account</param> /// <param name="clientId">The service's identfier or bundle id of your application</param> /// <param name="setting">Informations of the key that you are created for "Sign in with Apple"</param> public AppleTokenGenerator(string teamId, string clientId, AppleKeySetting setting) { _teamId = Guard.Argument(teamId, nameof(teamId)).NotNull().NotWhiteSpace(); _clientId = Guard.Argument(clientId, nameof(clientId)).NotNull().NotWhiteSpace(); _setting = Guard.Argument(setting, nameof(setting)).NotNull(); }
private AppleTokenGenerator CreateClient(AppleKeySetting keySetting = null) { keySetting ??= new AppleKeySetting(_keyId, _privateKey); return(new AppleTokenGenerator(_teamId, _clientId, keySetting)); }