SECURITY WARNING:"Please treat the URL above as you would your password and do not share it with anyone. in ios

こ雲淡風輕ζ 提交于 2019-12-02 13:21:50

问题


I am working on app that contains facebook login .After login with face book I need to go to native application & app should display user name & image that was there in face book .But when I am logining with facebook It is showing "SECURITY WARNING:"Please treat the URL above as you would your password and do not share it with anyone. in ios" ,& not coming back to my native app .Can any one sort this issue.I am using Facebook Graph api for face book.

In AppDelegate:

-(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{ 
  return [[_viewController facebook] handleOpenURL:url]; 
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { 
  return [[_viewController facebook] handleOpenURL:url]; 
}

回答1:


I had the same issue with my ios app and this is what i have done to resolve my problem. i have found the below url in my app and changed the connection from http to https.

earlier url: http://www.facebook.com/connect/login_success.html

changed url: https://www.facebook.com/connect/login_success.html

now it's working fine.




回答2:


I found one solution. I hope it will work for you.

Just paste this UIWebViewDelegate method in your FbGraph.m file....

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{

    if([request.URL.relativeString hasPrefix:@"https://www.facebook.com/connect/login_success.html" ])
        self.webView.hidden=TRUE;
    return YES;
}



回答3:


Solved per Zack24 on Apr 24.

Here is my webView loadRequest URL. Note the https for the redirect_uri.

https://graph.facebook.com/oauth/authorize?client_id=147261088671924&redirect_uri=https://www.facebook.com/connect/login_success.html&display=touch&type=user_agent&scope=read_stream,publish_stream




回答4:


Apart from implementing :

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation`

you have to add URL Types > URL Schemes into your application plist, with value : fb1234567890 where 1234567890 is your App ID.

See Item 5: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/



来源:https://stackoverflow.com/questions/16033462/security-warningplease-treat-the-url-above-as-you-would-your-password-and-do-n

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!