public FacebookApiService(IGraphApiConfiguration configuration) { this.configuration = configuration; this.apiUrl = !string.IsNullOrEmpty(this.configuration.ApiUrl) ? this.configuration.ApiUrl : FacebookApiConstants.ApiUrl; // wrap the end slash char in case user forgot about it if (!this.apiUrl.EndsWith("/")) { this.apiUrl = $"{this.apiUrl}/"; } }
internal static bool Validate(IGraphApiConfiguration config, DebugTokenResponse model) { DateTimeOffset expiredAtOffset = DateTimeOffset.FromUnixTimeSeconds(model.ExpiresAt); DateTime expiredAtUtc = expiredAtOffset.UtcDateTime; if (model.IsTokenValid && model.AppId == config.ApplicationId && DateTime.UtcNow < expiredAtUtc) { return(true); } return(false); }