Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to Use OAuth Access Token Obtained with Javascript to Authenticate with PHP
    primarykey
    data
    text
    <p>I'm writing an extension for Opera and it will use the Twitter OAuth API. I know it is frowned upon, but I'm implementing the Twitter OAuth with Javascript inside the extension. Please bear with me, because I'm not any pro with OAuth. </p> <p>But here's what I want to do. Once the user is authenticated with Twitter, I will store the access token in localStorage with the <strong>widget.preferences</strong> object available to Opera extensions. Here's the part I'm unsure about right now. In the extension, one will be able to post a comment. The comment will be posted from the extension to a script on a server which will process and insert the comment into a table in a database. </p> <p>The thing that I want to know about now is, how can I be sure the username of the person posting the comment is the real username of the user that posted the comment and logged in with Twitter in my extension? </p> <p>If I just sent the username from the extension, it would be extremely easy to just manipulate the username in the request, resulting in a fake username being inserted into the database with the comment. </p> <p>I could send the access token of the user posting the comment from the extension, the server would receive it with the comment data. Before inserting the comment into the database, could I use the access token sent from the Javascript extension to retrieve with PHP the Twitter username of the user represented by that access token? Or is the access token randomly created each time a user is authenticated so it can't be reused like this?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload