我正在尝试通过服务器到服务器方法与我的应用程序启用的BigQuery API进行通信.
我已经在这个Google指南上勾选了我在J #中构建我的JWT的所有方框.
我对Base64Url编码了所有必要的东西.
但是,我从谷歌获得的唯一回应是400 Bad Request
"error" : "invalid_request"
Run Code Online (Sandbox Code Playgroud)
我从以下其他SO问题中确认了以下所有问题:
当我使用Fiddler时,我得到了相同的结果.错误消息令人沮丧地缺乏细节!我还能尝试什么?!这是我的代码:
class Program
{
static void Main(string[] args)
{
// certificate
var certificate = new X509Certificate2(@"<Path to my certificate>.p12", "notasecret");
// header
var header = new { typ = "JWT", alg = "RS256" };
// claimset
var times = GetExpiryAndIssueDate();
var claimset = new
{
iss = "<email address of the client id of my app>",
scope = "https://www.googleapis.com/auth/bigquery",
aud = "https://accounts.google.com/o/oauth2/token", …Run Code Online (Sandbox Code Playgroud)