I need to make an authorization with asana in my app. I'm using OAuth2Client library for oauth authorization.
Configuring:
[[NXOAuth2AccountStore sharedStore] setClientID:@"my_clientID"
secret:@"my_client_secret"
authorizationURL:[NSURL URLWithString:@"https://app.asana.com/-/oauth_authorize"]
tokenURL:[NSURL URLWithString:@"https://app.asana.com/-/oauth_token"]
redirectURL:[NSURL URLWithString:@"http://localhost:3000"]// <-- this is the problem part
forAccountType:@"myService"];
Requesting:
[[NXOAuth2AccountStore sharedStore] requestAccessToAccountWithType:@"myService"];
It launches Safari with authorization, asks me about permissions and then it redirect to redirectURL
. But what redirectURL
should I use (here and in account settings), to redirect back to my application? Or maybe I'm doing it wrong?
Thanks in advance.
I recommend using a custom URI handler, like "myapp://oauth/asana", and configuring your app to be registered to myapp://
(of course, replacing myapp
with something more specific to, well, your app).