身份验证期间出现“client_id not provided”错误

时间:2013-11-28 13:20:57

标签: ios objective-c authentication stackexchange

我正在尝试在我的ios应用程序中实现堆栈交换隐式身份验证。

以下是https://api.stackexchange.com/docs/authentication

中提到的基本身份验证步骤
1.Open a new window at https://stackexchange.com/oauth/dialog, with these query string parameters
    client_id
    scope (details)
    redirect_uri - must be under an apps registered domain
    state - optional
2.The user approves your app
3.The user is redirected to redirect_uri, with these parameters in the hash
    access_token
4.expires - optional, only if scope doesn't contain no_expiry

我在viewDidLoad中使用以下代码,但我没有提供client_id错误。

UIWebView * pwebview = [[UIWebView alloc] initWithFrame:self.view.frame];

[pwebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://stackexchange.com/oauth/dialog?client_id=nt8DK1dnMHPsPAH6a9ZsLQ&scope=read_inbox,no_expiry,private_info&redirect_uri=https://stackexchange.com/oauth/login_success"]]];

[pwebview setScalesPageToFit:YES];

[self.view addSubview:pwebview];
请告诉我我错在哪里。

提前谢谢。

0 个答案:

没有答案