I am attempting to form a json request to authenticate using oath2 specification for Google's "Service Account" authentication. I am using google's documentation here. It is using JWT. It seems that there is not much information on how to do this using C#. This is the RAW json request that I am using, but the only response I can get from google is "invalid_request".
POST https://accounts.google.com/o/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: accounts.google.com
Content-Length: 457
Expect: 100-continue
Connection: Keep-Alive
{
"grant_type": "assertion",
"assertion_type": "http://oauth.net/grant_type/jwt/1.0/bearer",
"assertion": "JWT (including signature)"
}
Any ideas on what could be going on? I am attempting to create a windows service that pings google latitude locations at set intervals? Is there potentially another way to get access to that API without jumping through this hoop? Thanks!