在Facebook中重定向URI的目的 [英] purpose of redirect URI in facebook

查看:43
本文介绍了在Facebook中重定向URI的目的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到我们在Facebook中创建应用程序时提供了一个URL,所以假设这是URL 1.然后,在我们的代码中,我们提供另一个 redirect_uri

I noticed that we supply a URL while creating our app in facebook, so suppose this is URL 1 . Then within our code we supply another redirect_uri,

 $params = array(
    'scope' => $config['facebook_scope']
    'redirect_uri' => $config['root'].'php/class/fbLogin.php'
);

$link = $facebook->getLoginUrl($params);
echo $link;
    header('location: '.$link);

如果我们已经在我们的应用程序中提供了重定向Uri,那么网站URL的目的是什么

whats the purpose of site URL if we already provide a redirect Uri in our app

2-在创建应用程序时,还有一个称为回调URL的东西.

2- There is also something called callback URL in the creation of app.

我只是想知道您的3个UR彼此有何不同

I was just curious to know how thee 3 URls are different from each other

我从她那里了解了redirect_uri e

推荐答案

在oAuth流程中,重定向uri是您的用户在授权(或未授权)您的应用程序后将被发送回的位置.重定向页面通常会收到一些有关授权,身份验证代码,令牌等的额外信息.

In the oAuth process the redirect uri is where your user will be sent back to once they have authorised (or not) your application. The redirect page will often receive some extra information about authorisation, an auth code, token etc.

出于安全原因,重定向uri必须与注册应用程序时提供的重定向uri匹配.这样,即使应用程序机密受到破坏,被攻击者也仍然必须接管重定向页面才能攻击用户帐户.尝试使用不匹配的重定向uri对用户进行身份验证将导致错误.

The redirect uri has to match the one provided when registering the application for security reasons. This way, even if the applications secret was compromised, an attacked would still have to also take over the redirect page in order to attack user accounts. Attempts to authenticate users with a non-matching redirect uri will result in an error.

这篇关于在Facebook中重定向URI的目的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆