2013-12-10 45 views
2

我需要在我的應用程序與asana授權。我使用OAuth2Client庫進行oauth授權。oauth授權與體式(重定向網址)

配置:

[[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"]; 

請求:

[[NXOAuth2AccountStore sharedStore] requestAccessToAccountWithType:@"myService"]; 

它啓動Safari瀏覽器與授權,問我的權限,然後將其重定向到redirectURL。但我應該使用什麼redirectURL(這裏和帳戶設置),重定向回我的應用程序?或者,也許我做錯了?

在此先感謝。

回答

1

我建議使用一個自定義的URI處理程序,如「MYAPP://的OAuth /體位法」,並配置您的應用程序註冊到myapp://(當然,有更具體的,好東西取代myapp,您的應用程序)。