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

Feat/auth : Rejects malformed JWTToken and requireValidToken Option #597

Merged
merged 72 commits into from
Aug 14, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
cef7a1d
Added password grant_type option
alain-charles Jun 29, 2018
9f0dbab
Added password grant_type option implementation
alain-charles Jun 29, 2018
44d7d2e
Playground sample for oAuth2 password grant-type
alain-charles Jun 29, 2018
f57b737
Added route to oAuth2 password grant-type sample
alain-charles Jun 29, 2018
ed4628e
Addes angular-jwt for decoding jwt token (used in playground only)
alain-charles Jun 29, 2018
d7f01df
Added /api/auth/token endpoint (oAuth2 password grant-type playground)
alain-charles Jun 29, 2018
af52e88
Patched code for passing ci
alain-charles Jun 29, 2018
554f7dc
code optimization for passing ci
alain-charles Jun 29, 2018
fa0548f
Merge branch 'master' into master
nnixaa Jun 29, 2018
b72adae
Changes request by Dmitry (first review)
alain-charles Jun 29, 2018
733efc0
Generalized code in oauth2-strategy
alain-charles Jun 29, 2018
57fab69
Merge remote-tracking branch 'origin/master'
alain-charles Jun 29, 2018
c50df3a
Generalized code in oauth2-strategy
alain-charles Jun 29, 2018
dda5436
Added unit tests for oAuth-strategy password authentication
alain-charles Jul 2, 2018
ef0be25
Merge branch 'master' into master
alain-charles Jul 3, 2018
e180dc3
Merge branch 'master' into master
nnixaa Jul 4, 2018
6aa1fdb
Cleaned code according to nnixaa second review
alain-charles Jul 4, 2018
96c7344
Merge branch 'master' of https://github.com/alain-charles/nebular
alain-charles Jul 4, 2018
cf82c42
Removed package-lock.json from git repo
alain-charles Jul 4, 2018
dcff930
package-lock.json to revert
alain-charles Jul 4, 2018
315662f
reverted package-lock.json
alain-charles Jul 4, 2018
57a0230
Added new grant_type 'PASSWORD' in the block comment for it to be ins…
alain-charles Jul 4, 2018
d69d633
Merge remote-tracking branch 'upstream/master'
alain-charles Jul 5, 2018
1be8d91
Add the refreshtoken request management in NbJwtInterceptor and NbAut…
alain-charles Jul 13, 2018
4b67825
Merge branch 'master' of https://github.com/alain-charles/nebular
alain-charles Jul 19, 2018
deea3e2
Merge branch 'master' into temp
alain-charles Jul 19, 2018
acd0241
The token now contains ownerStrategyName, with is a back link to the …
alain-charles Jul 19, 2018
25250f0
feature/auth:
alain-charles Jul 19, 2018
c0fdd31
feature/auth:
alain-charles Jul 19, 2018
bd564b3
feature/auth:
alain-charles Jul 20, 2018
44ed61a
Merge branch 'master' into master
nnixaa Jul 20, 2018
9c16387
feature/auth
alain-charles Jul 24, 2018
2dd26c4
Merge remote-tracking branch 'origin/master'
alain-charles Jul 24, 2018
b284377
Merge branch 'master' into master
alain-charles Jul 24, 2018
e462c7d
feature/auth
alain-charles Jul 24, 2018
a3ee10b
Merge branch 'master' into master
nnixaa Jul 24, 2018
b38ae55
Merge branch 'master' into master
nnixaa Jul 25, 2018
62a2aff
feature/auth
alain-charles Jul 25, 2018
66ca493
Merge remote-tracking branch 'origin/master'
alain-charles Jul 25, 2018
3bd5a50
feature/auth
alain-charles Jul 25, 2018
398c058
feature/auth
alain-charles Jul 25, 2018
ee706d3
Merge branch 'master' into master
alain-charles Jul 26, 2018
5eb5821
feature/auth
alain-charles Jul 26, 2018
1a08225
Merge remote-tracking branch 'origin/master'
alain-charles Jul 26, 2018
1d697bc
feature/auth
alain-charles Jul 27, 2018
1c25956
Merge remote-tracking branch 'upstream/master'
alain-charles Jul 27, 2018
ff0e8d3
Merge remote-tracking branch 'upstream/master'
alain-charles Jul 27, 2018
e7af99e
Optimized getAccessTokenPayload() calls
alain-charles Jul 28, 2018
95632b1
Optimized getAccessTokenPayload() calls
alain-charles Jul 28, 2018
bc4001f
Merge branch 'master' into master
nnixaa Jul 30, 2018
e06a45c
Feat/auth
alain-charles Jul 31, 2018
7c6fc43
Merge remote-tracking branch 'upstream/master' into feat/auth-Automat…
alain-charles Jul 31, 2018
88c7106
Moved code from tokenservice to strategy.
alain-charles Jul 31, 2018
76dda02
Added setRefreshToken(token)
alain-charles Jul 31, 2018
a75f75b
Merge remote-tracking branch 'upstream/master' into feat/auth_require…
alain-charles Aug 1, 2018
ab75598
feat/auth
alain-charles Aug 2, 2018
2ad04ba
feat/auth
alain-charles Aug 2, 2018
cfe6b87
Merge remote-tracking branch 'upstream/master' into feat/auth_require…
alain-charles Aug 2, 2018
ad90f20
feat/auth
alain-charles Aug 2, 2018
66cf701
Merge remote-tracking branch 'upstream/master' into feat/auth_require…
alain-charles Aug 7, 2018
9d35278
Removed not released failWhenNoToken from password strategy as requir…
alain-charles Aug 7, 2018
432b2cc
Corrected import paths
alain-charles Aug 7, 2018
01e2c2f
Merge remote-tracking branch 'upstream/master' into feat/auth_require…
alain-charles Aug 7, 2018
a22d3ef
Merge branch 'master' into feat/auth_requireValidToken
nnixaa Aug 7, 2018
ffef510
Merge branch 'master' into feat/auth_requireValidToken
nnixaa Aug 8, 2018
03e1fae
Payload(s) are now parsed during token construction
alain-charles Aug 9, 2018
cb1bfed
Merge remote-tracking branch 'upstream/master' into feat/auth_require…
alain-charles Aug 9, 2018
b6a9db6
Merge remote-tracking branch 'origin/feat/auth_requireValidToken' int…
alain-charles Aug 9, 2018
4b57287
Inverted error test in parsePayload
alain-charles Aug 10, 2018
27d74a7
Merge branch 'master' into feat/auth_requireValidToken
nnixaa Aug 13, 2018
9a8d41f
Merge remote-tracking branch 'upstream/master' into feat/auth_require…
alain-charles Aug 14, 2018
ae46531
Merge remote-tracking branch 'origin/feat/auth_requireValidToken' int…
alain-charles Aug 14, 2018
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
Prev Previous commit
Next Next commit
Merge branch 'master' into master
  • Loading branch information
alain-charles authored Jul 24, 2018
commit b2843771b7bb48d82ec99b6dcaa9fba98d4e0253
1 change: 1 addition & 0 deletions src/framework/auth/services/token/token-parceler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { NB_AUTH_TOKENS } from '../../auth.options';
describe('token-parceler', () => {

let tokenParceler: NbAuthTokenParceler;

const createdAt = new Date(1532350800000);
const simpleToken = nbAuthCreateToken(NbAuthSimpleToken, 'test value', 'strategy', createdAt);
// tslint:disable-next-line
Expand Down
2 changes: 2 additions & 0 deletions src/framework/auth/services/token/token-parceler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class NbAuthTokenParceler {
let tokenValue = '';
let tokenOwnerStrategyName = '';
let tokenCreatedAt: Date = null;

const tokenPack: NbTokenPack = this.parseTokenPack(value);
if (tokenPack) {
tokenClass = this.getClassByName(tokenPack.name) || this.fallbackClass;
Expand All @@ -45,6 +46,7 @@ export class NbAuthTokenParceler {
}

return nbAuthCreateToken(tokenClass, tokenValue, tokenOwnerStrategyName, tokenCreatedAt);
}
}

// TODO: this could be moved to a separate token registry
Expand Down
3 changes: 3 additions & 0 deletions src/framework/auth/services/token/token.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ describe('auth token', () => {
// without token
expect(new NbAuthJWTToken('', 'strategy', new Date()).isValid()).toBeFalsy();


// expired date
expect(expiredJWTToken.isValid()).toBeFalsy();
});
Expand Down Expand Up @@ -146,7 +147,9 @@ describe('auth token', () => {
example_parameter: 'example_value',
};


let validToken = new NbAuthOAuth2Token(token, 'strategy');

const emptyToken = new NbAuthOAuth2Token({}, 'strategy');

const noExpToken = new NbAuthOAuth2Token({
Expand Down
3 changes: 2 additions & 1 deletion src/framework/auth/services/token/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ export class NbAuthSimpleToken extends NbAuthToken {
static NAME = 'nb:auth:simple:token';

constructor(protected readonly token: any,

protected readonly ownerStrategyName: string,
protected createdAt?: Date) {
super();
// If not coming back from local storage, simple token get 'now' for createdAt
if (!this.createdAt) {
this.buildCreatedAt();
}
Expand Down Expand Up @@ -184,6 +184,7 @@ export class NbAuthOAuth2Token extends NbAuthSimpleToken {
constructor(protected data: { [key: string]: string|number }|string = {},
protected ownerStrategyName: string,
protected createdAd?: Date) {

// we may get it as string when retrieving from a storage
super(prepareOAuth2Token(data), ownerStrategyName);
}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.