Giter VIP home page Giter VIP logo

Comments (18)

uzyn avatar uzyn commented on September 18, 2024

Error 401 could be due to testing from unauthorized domains.
To make sure that the domain you are tested from are authorized, please follow Step 2

Reference: https://dev.twitter.com/discussions/13717

from twitter.

chrisburton avatar chrisburton commented on September 18, 2024

Hmm. I tested on localhost but I also tested this on the domain I specified for my app and received the same result.

from twitter.

uzyn avatar uzyn commented on September 18, 2024

The error is returned by Twitter, so you may have to check with Twitter on that.

from twitter.

chrisburton avatar chrisburton commented on September 18, 2024

Also, just to note, I'm getting this error as well: http://chrisburton.me/twitter/example

I'll contact them now. Thank you.

from twitter.

uzyn avatar uzyn commented on September 18, 2024

That's not an error.

You should be requesting for a particular strategy, ie. http://chrisburton.me/twitter/example/twitter and not http://chrisburton.me/twitter/example

from twitter.

chrisburton avatar chrisburton commented on September 18, 2024

Not to bug you however, if the problem was on Twitter's end, why would it work with an alternate library?

See here: http://chrisburton.me/auth/

from twitter.

uzyn avatar uzyn commented on September 18, 2024

Would you mind to share your Opauth config?

from twitter.

chrisburton avatar chrisburton commented on September 18, 2024
<?php
/**
 * Opauth basic configuration file to quickly get you started
 * ==========================================================
 * To use: rename to opauth.conf.php and tweak as you like
 * If you require advanced configuration options, refer to opauth.conf.php.advanced
 */

$config = array(
/**
 * Path where Opauth is accessed.
 *  - Begins and ends with /
 *  - eg. if Opauth is reached via http://example.org/auth/, path is '/auth/'
 *  - if Opauth is reached via http://auth.example.org/, path is '/'
 */
    'path' => '/twitter/example/',

/**
 * Callback URL: redirected to after authentication, successful or otherwise
 */
    'callback_url' => '{path}callback.php',

/**
 * A random string used for signing of $auth response.
 */
    'security_salt' => 'LDFmiilYf8Fyw5W10rx4W1KsVrieQCnpBzzpTBWA',

/**
 * Strategy
 * Refer to individual strategy's documentation on configuration requirements.
 * 
 * eg.
 * 'Strategy' => array(
 * 
 *   'Facebook' => array(
 *      'app_id' => 'APP ID',
 *      'app_secret' => 'APP_SECRET'
 *    ),
 * 
 * )
 *
 */
    'Strategy' => array(

        'Twitter' => array(
            'key' => 'CONSUMER KEY',
            'secret' => 'CONSUMER SECRET'
        )
    )
);

from twitter.

uzyn avatar uzyn commented on September 18, 2024

Do you forget to define your consumer key and secret?

    'Strategy' => array(

        'Twitter' => array(
            'key' => 'CONSUMER KEY',
            'secret' => 'CONSUMER SECRET'
        )
    )

from twitter.

chrisburton avatar chrisburton commented on September 18, 2024

Not in my production version. I removed them before pasting here. I can send you a zip file if you'd like to test my code.

from twitter.

uzyn avatar uzyn commented on September 18, 2024

Sure. Just paste the link here.

from twitter.

chrisburton avatar chrisburton commented on September 18, 2024

I removed my key and token stuff. http://cloud.chrisburton.me/2F2E1x1P180G

from twitter.

uzyn avatar uzyn commented on September 18, 2024

Used your zip, changed only 2 lines, ie. the key and secret.
Worked perfectly.

Hmm, you may wish to check that you have OpenSSL enabled at your PHP setup. You can check via phpinfo().

from twitter.

chrisburton avatar chrisburton commented on September 18, 2024

You mean this?

SSL Version OpenSSL/0.9.8u

from twitter.

uzyn avatar uzyn commented on September 18, 2024

Yup! Seems like you have it. It's strange as your code runs perfectly fine.

If you would like to try out a pre-configured one, you can probably checkout the code from uzyn/opauth.org. Even the keys are there.

Thanks.

from twitter.

chrisburton avatar chrisburton commented on September 18, 2024

I know why it failed. I inserted my access token and key into other files. If I ONLY insert my consumer key and secret in the config file, it works.

from twitter.

uzyn avatar uzyn commented on September 18, 2024

Glad it's solved. :)

from twitter.

svadivelpriyan avatar svadivelpriyan commented on September 18, 2024

I got an empty reponse can you help me to find out the error

from twitter.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.