문제

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).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top