diff --git a/README.md b/README.md index 7fb8525539..a7ba39d9d5 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ The goal of an authentication flow is to [set an Okta session cookie on the user - `username` - User’s non-qualified short-name (e.g. dade.murphy) or unique fully-qualified login (e.g dade.murphy@example.com) - `password` - The password of the user - - `sendFingerprint` - Enabling this will send a `X-Device-Fingerprint` header. Defaults to `false` + - `sendFingerprint` - Enabling this will send a `X-Device-Fingerprint` header. Defaults to `false` ```javascript authClient.signIn({ diff --git a/lib/tx.js b/lib/tx.js index aba77843c3..e1a1a6ccf9 100644 --- a/lib/tx.js +++ b/lib/tx.js @@ -48,8 +48,8 @@ function transactionExists(sdk) { return !!sdk.tx.exists._getCookie(config.STATE_TOKEN_COOKIE_NAME); } -function postToTransaction(sdk, url, body, options) { - return http.post(sdk, url, body, options) +function postToTransaction(sdk, url, args, options) { + return http.post(sdk, url, args, options) .then(function(res) { return new AuthTransaction(sdk, res); }); diff --git a/test/spec/fingerprint.js b/test/spec/fingerprint.js index 4754dfe541..a6ec8e4e38 100644 --- a/test/spec/fingerprint.js +++ b/test/spec/fingerprint.js @@ -177,6 +177,35 @@ define(function(require) { } }); + util.itMakesCorrectRequestResponse({ + title: 'does not attach fingerprint to signIn requests if addFingerprint is false', + setup: { + uri: 'http://example.okta.com', + calls: [ + { + request: { + method: 'post', + uri: '/api/v1/authn', + data: { username: 'not', password: 'real' }, + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'X-Okta-User-Agent-Extended': 'okta-auth-js-' + packageJson.version + } + }, + response: 'success' + } + ] + }, + execute: function (test) { + return test.oa.signIn({ + username: 'not', + password: 'real', + sendFingerprint: false + }); + } + }); + it('fails signIn request if fingerprinting fails', function(done) { return setup({ firstMessage: 'invalidMessageContent' }) .signIn({