How to use the ohauth.authHeader function in ohauth

To help you get started, we’ve selected a few ohauth examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WP-API / api-console / js / auth.js View on Github external
}

        // https://tools.ietf.org/html/rfc5849#section-3.4.1.3.1
        if ((!options || !options.headers ||
            options.headers['Content-Type'] === 'application/x-www-form-urlencoded') &&
            options.data) {
            params = xtend(params, ohauth.stringQs(options.data));
        }

        params.oauth_token = token('oauth_token');
        params.oauth_signature = ohauth.signature(
            o.oauth_secret,
            oauth_token_secret,
            ohauth.baseString(method, canonical_url, params));

	    xhr.setRequestHeader( "Authorization", 'OAuth ' + ohauth.authHeader(params) );
    }

ohauth

Pure-browser OAuth for CORS-supporting sites like OpenStreetMap

ISC
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis