Skip to content

Commit

Permalink
Address nits
Browse files Browse the repository at this point in the history
  • Loading branch information
lboyette-okta committed Jan 16, 2018
1 parent a3f0bd6 commit 171368a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected])
- `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({
Expand Down
4 changes: 2 additions & 2 deletions lib/tx.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
31 changes: 30 additions & 1 deletion test/spec/fingerprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ define(function(require) {
});

util.itMakesCorrectRequestResponse({
title: 'attaches fingerprint to signIn requests if addFingerprint is true',
title: 'attaches fingerprint to signIn requests if sendFingerprint is true',
setup: {
uri: 'http://example.okta.com',
calls: [
Expand Down Expand Up @@ -177,6 +177,35 @@ define(function(require) {
}
});

util.itMakesCorrectRequestResponse({
title: 'does not attach fingerprint to signIn requests if sendFingerprint 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({
Expand Down

0 comments on commit 171368a

Please sign in to comment.