Can a Windows Application be registered?


#1

I am trying to get started with the asana API in my C# Windows Application. I don’t have a URL. What do I put in the APP URL box?


#2

@Paul_Mayer maybe you can help?

Bastien
Asana consultant, author and developer


#3

If you can get away with using a personal access token (you’re only testing or only need the app to authorize as a single user) they are a bit simpler to get started with.

If you’re interested in testing as a real OAuth app (for instance if you want to test the login flow) you will eventually need a URL to redirect to during the auth flow, even if this is “localhost” for testing.

In any case, app url is meant to provide a location that you might promote your app from and maybe in the future we might provide a way to link to this from Asana, but it can be any valid URL, really. https://example.com is a perfectly valid choice :wink:


#4

OK, thanks. I entered my company’s website but didn’t really think it would work but maybe based on what you said, it will. It makes sense to put this in both APP URL and REDIRECT URL?
I am taking a break from this as I was beginning to get frustrated and kept hitting dead-ends. I will work on it piecemeal, one step at a time. Expect another question soon!


#5

Now I am trying this:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
using (var httpclient = new System.Net.Http.HttpClient())
{
var url = “https://app.asana.com/-/oauth_token”;

            var json = "{\"grant_type\": \"authorization_code\",\"client_id\": \"xxIDxx\",\"client_secret\": \"xxSecretxx\",\"redirect_uri\": \"urn:ietf:wg:oauth:2.0:oob\",\"code\": \"xxAccessTokenxx\" }";

            var content = new System.Net.Http.StringContent(json, Encoding.UTF8, "application/json");

            var response = httpclient.PostAsync(url, content).Result;

But the response I get back is Bad Request.
Any ideas?


#6

I have narrowed down my issue, Please see new ticket It works in VB.NET but not in C#