Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAuth 'Could not verify OAuth request' #513

Open
cybercussion opened this issue Feb 14, 2023 · 0 comments
Open

OAuth 'Could not verify OAuth request' #513

cybercussion opened this issue Feb 14, 2023 · 0 comments

Comments

@cybercussion
Copy link

I've made a number of attempts to call xAPI/OAuth/initiate using a few different off the shelf OAuth 1.0a libraries.

For example -

// Dependencies
const request = require('request')
const OAuth = require('oauth-1.0a')
const crypto = require('crypto')

process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;

// Initialize
const oauth = OAuth({
    consumer: {
        key: 'f736064db682425f9fdc41c4db62cc08',
        secret: '4aBK3L9aYyliEp3w',
    },
    signature_method: 'HMAC-SHA1',
    hash_function(base_string, key) {
        return crypto
            .createHmac('sha1', key)
            .update(base_string)
            .digest('base64')
    },
})

const request_data = {
    url: 'https://127.0.0.1/xAPI/OAuth/initiate',
    method: 'POST',
    data: {oauth_callback: 'oob'}
}

// Note: The token is optional for some requests
// const token = {
//     key: 'd587c1612bbb4153a44c3a42d6ef6d5a',
//     secret: 'vWALvHvT6nWX9Swm',
// }

request(
    {
        url: request_data.url,
        method: request_data.method,
        form: oauth.authorize(request_data, ''), // token
    },
    function(error, response, body) {
        // Process your data here
        console.log('ERROR:\n' + error, response, body);
    }
)

All that comes back is "Could not verify OAuth request" and a DENY.
Not much info on how to obtain temp token beyond that.

Is there a cleaner mechanism of proving this is functioning?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant