Skip to content

Commit

Permalink
Fix device parameter not being whitelisted for authorization (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelamjad authored and glena committed Jan 16, 2017
1 parent b9ffbb2 commit 523b08c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/helper/parameters-whitelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var authorize_params = [
'connection_scope',
'auth0Client',
'owp',
'device',
// oauth2
'client_id',
'response_type',
Expand Down
14 changes: 13 additions & 1 deletion test/authentication/authentication.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,18 @@ describe('auth0.authentication', function () {

expect(url).to.be('https://me.auth0.com/authorize?client_id=...&response_type=token&redirect_uri=http%3A%2F%2Fanotherpage.com%2Fcallback2&state=1234&prompt=none');
})

it('should return a url using using whitelisted authorization parameter device', function() {
var url = this.auth0.buildAuthorizeUrl({
responseType: 'token',
redirectUri: 'http://anotherpage.com/callback2',
prompt: 'none',
state: '1234',
device: 'my-device'
});

expect(url).to.be('https://me.auth0.com/authorize?device=my-device&client_id=...&response_type=token&redirect_uri=http%3A%2F%2Fanotherpage.com%2Fcallback2&state=1234&prompt=none');
})
})

context('buildAuthorizeUrl with Telemetry', function () {
Expand Down Expand Up @@ -528,4 +540,4 @@ describe('auth0.authentication', function () {
});
});

})
})

0 comments on commit 523b08c

Please sign in to comment.