The Movie Database 支持

Hello Everyone, I'm developing a desktop application using Reacts, Nodejs and Express. Facing tough time to implement authentication. Could any one help with steps. Thanks for your time. I have followed all the steps mentioned in api docs still I'm not getting hit to redirect url.

10 回复(第 1 页,共 1 页)

Jump to last post

Hi @anandrikka Which issue are you running into problems with specifically? Is it just with the redirect step? Ie. in step 2, when you send the user to the website and ask for permission, you're setting the redirect_to parameter?

Hello Travis,

Here are the steps I followed

  1. redirected from UI to server using href
  2. Generated request token and redirected to url mentioned in step 2
  3. logged in and gave permission to app
  4. It's not redirecting to url mentioned in step 2.

Here is the sample code

app.get('/api/login', function (req, res) {
    tmdbApi.requestToken().then(function (tokenResult) {
        res.redirect('https://www.themoviedb.org/authenticate/' + tokenResult.data.request_token  +
            '?redirect_to = http ://localhost/api/callback')
    }, function (error) {

    })
});

If logged in, I need to redirect to "/api/callback" call to proceed further. Please let me know if I missed anything.

Thanks for your time

One thing I'm just curious about is that you have a space after your = AND http. Does this help?

app.get('/api/login', function (req, res) {
    tmdbApi.requestToken().then(function (tokenResult) {
        res.redirect('https://www.themoviedb.org/authenticate/' + tokenResult.data.request_token  +
            '?redirect_to=http://localhost/api/callback')
    }, function (error) {

    })
});

I did observed and removed the space and tried it just didn't work.

However in the below scenario it's hitting the callback mentioned in redirect url

"User should be already logged into the tmdb application. When redirected from my app it just asks for permission to grant access, when user approved it's hitting callback mentioned in redirect url."

Failure scenario: "when user redirected from my application and then logged into tmdb and gave permission to my app, then it's not redirecting to url."

I guess I have expressed it correctly, let me know if more details needed.

Need some help from anyone to close the issue.

The redirection URL might not be getting saved properly when the user is logged out. I'll investigate this Monday morning when I get back to work and let you know when it has been fixed.

Thanks Travis. Will be waiting for your reply !!

Can you give this a try now and let me know if it's working properly for you now?

Excellent Travis, It's working !! Tested a straight use case it's getting redirected to callback url. There are few more doubts may be I will open up separate discussion.

Thanks once again, for your time and patience !!

Happy to hear it's working.

Cheers.

找不到电影或节目?登录并创建它吧。

全站通用

s 聚焦到搜索栏
p 打开个人资料菜单
esc 关闭打开的窗口
? 打开键盘快捷键窗口

在媒体页面

b 返回(或返回上级)
e 进入编辑页面

在电视季页面

(右箭头)下一季
(左箭头)前一季

在电视集页面

(右箭头)下一集
(左箭头)上一集

在所有图像页面

a 打开添加图片窗口

在所有编辑页面

t 打开翻译选择器
ctrl+ s 提交

在讨论页面

n 创建新讨论
w 切换关注状态
p 设为公开 / 私密讨论
c 关闭 / 开放讨论
a 打开活动页
r 回复讨论
l 跳转至最新回复
ctrl+ enter 发送信息
(右箭头)下一页
(左箭头)前一页

设置

想给这个条目评分或将其添加到片单中?

登录

还不是会员?

注册加入社区