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

Changed default audience #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/corbel.js
Original file line number Diff line number Diff line change
Expand Up @@ -1828,7 +1828,7 @@
};

Iam.GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:jwt-bearer';
Iam.AUD = 'http://iam.bqws.io';
Iam.AUD = 'http://iam.corbel.io';
Iam.IAM_TOKEN = 'iamToken';
Iam.IAM_TOKEN_SCOPES = 'iamScopes';

Expand Down
2 changes: 1 addition & 1 deletion dist/corbel.with-polyfills.js
Original file line number Diff line number Diff line change
Expand Up @@ -2826,7 +2826,7 @@
};

Iam.GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:jwt-bearer';
Iam.AUD = 'http://iam.bqws.io';
Iam.AUD = 'http://iam.corbel.io';
Iam.IAM_TOKEN = 'iamToken';
Iam.IAM_TOKEN_SCOPES = 'iamScopes';

Expand Down
2 changes: 1 addition & 1 deletion src/iam/iam.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
};

Iam.GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:jwt-bearer';
Iam.AUD = 'http://iam.bqws.io';
Iam.AUD = 'http://iam.corbel.io';
Iam.IAM_TOKEN = 'iamToken';
Iam.IAM_TOKEN_SCOPES = 'iamScopes';

Expand Down
10 changes: 5 additions & 5 deletions test/node/unit/jwt.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ describe('JWT module', function() {
var secret = 'secret',
claims = {
'iss': CLIENT_ID,
'aud': 'http://iam.bqws.io',
'aud': 'http://iam.corbel.io',
'exp': 1391535,
'scope': SCOPES,
'version': '1.0.0'
};
var EXPECTED_ASSERTION = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJDTElFTlRfSUQiLCJhdWQiOiJodHRwOi8vaWFtLmJxd3MuaW8iLCJleHAiOjEzOTE1MzUsInNjb3BlIjoic2NvcGUxIHNjb3BlMiIsInZlcnNpb24iOiIxLjAuMCJ9._TCKYb3gbsuznfwA1gopY4mSYr7VHmvFQGxW1CJJjHQ';
var EXPECTED_ASSERTION = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJDTElFTlRfSUQiLCJhdWQiOiJodHRwOi8vaWFtLmNvcmJlbC5pbyIsImV4cCI6MTM5MTUzNSwic2NvcGUiOiJzY29wZTEgc2NvcGUyIiwidmVyc2lvbiI6IjEuMC4wIn0.Lkr2LKGv-qyPX6wW30rIB7xHU2svwIYeCx22aegtrJE';

// without alg
var assertion = corbel.jwt.generate(claims, secret);
Expand All @@ -48,12 +48,12 @@ describe('JWT module', function() {
var secret = 'secret',
claims = {
iss: 'clientId',
aud: 'http://iam.bqws.io',
aud: 'http://iam.corbel.io',
exp: 12345,
scope: 'scope:example1 scope:example2'
};

var EXPECTED = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjbGllbnRJZCIsImF1ZCI6Imh0dHA6Ly9pYW0uYnF3cy5pbyIsImV4cCI6MTIzNDUsInNjb3BlIjoic2NvcGU6ZXhhbXBsZTEgc2NvcGU6ZXhhbXBsZTIifQ.18g9YO_KgWtW1s7HSo87mIjG02u8Pe880tdLbg_JxC4';
var EXPECTED = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjbGllbnRJZCIsImF1ZCI6Imh0dHA6Ly9pYW0uY29yYmVsLmlvIiwiZXhwIjoxMjM0NSwic2NvcGUiOiJzY29wZTpleGFtcGxlMSBzY29wZTpleGFtcGxlMiJ9.I8wVQbmqoX5LlXHrRzbp5mzaUMBqu6zLhhAvyyNJI6g';

var assertion = corbel.jwt.generate(claims, secret);
expect(assertion).to.be.equal(EXPECTED);
Expand All @@ -68,7 +68,7 @@ describe('JWT module', function() {
expect(jwtDecoded.alg).to.be.equal('HS256');

expect(jwtDecoded.iss).to.be.equal('clientId');
expect(jwtDecoded.aud).to.be.equal('http://iam.bqws.io');
expect(jwtDecoded.aud).to.be.equal('http://iam.corbel.io');
expect(jwtDecoded.exp).to.be.equal(12345);
expect(jwtDecoded.scope).to.be.equal('scope:example1 scope:example2');
});
Expand Down