Question Details

Answered
Get Link Line Linking Account not work

I'm working on a feature linking account of application and Line account (Rails project). I implement my code step by step as document here Everything works perfect. But I face a trouble at step 4: Generate a nonce and redirect the user to the LINE Platform When I access this link from browser, It works fine:

https://access.line.me/dialog/bot/accountLink?linkToken={link token}&nonce={nonce}

But when I try to access it by Faraday gem, it did not work:

response = Faraday.get("https://access.line.me/dialog/bot/accountLink?linkToken=#{link token}&nonce=#{nonce}")
response.status # 302
response.["x-frame-options"] # "DENY, DENY"

Why It did not work and is there any way to active this link by code (not by paste into browser)?

Thank you for your hepl!

0
Edited: 6 months ago
Profile picture
Le Chi Nguyen

Answers

1
Profile picture
Curry Doria
Posted: 6 months ago

You need to follow 302 redirects. You can use the FaradayMiddleware::FollowRedirects. Please refer this page: https://github.com/lostisland/faraday_middleware/issues/32

Are you sure? question.vm