-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 improvement : refresh-token are now saved if not repeated by the backend refresh endpoint #593
Merged
nnixaa
merged 60 commits into
akveo:master
from
alain-charles:feat/auth-AutomaticRefreshToken
Aug 7, 2018
Merged
Feat/auth improvement : refresh-token are now saved if not repeated by the backend refresh endpoint #593
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
cef7a1d
Added password grant_type option
alain-charles 9f0dbab
Added password grant_type option implementation
alain-charles 44d7d2e
Playground sample for oAuth2 password grant-type
alain-charles f57b737
Added route to oAuth2 password grant-type sample
alain-charles ed4628e
Addes angular-jwt for decoding jwt token (used in playground only)
alain-charles d7f01df
Added /api/auth/token endpoint (oAuth2 password grant-type playground)
alain-charles af52e88
Patched code for passing ci
alain-charles 554f7dc
code optimization for passing ci
alain-charles fa0548f
Merge branch 'master' into master
nnixaa b72adae
Changes request by Dmitry (first review)
alain-charles 733efc0
Generalized code in oauth2-strategy
alain-charles 57fab69
Merge remote-tracking branch 'origin/master'
alain-charles c50df3a
Generalized code in oauth2-strategy
alain-charles dda5436
Added unit tests for oAuth-strategy password authentication
alain-charles ef0be25
Merge branch 'master' into master
alain-charles e180dc3
Merge branch 'master' into master
nnixaa 6aa1fdb
Cleaned code according to nnixaa second review
alain-charles 96c7344
Merge branch 'master' of https://github.com/alain-charles/nebular
alain-charles cf82c42
Removed package-lock.json from git repo
alain-charles dcff930
package-lock.json to revert
alain-charles 315662f
reverted package-lock.json
alain-charles 57a0230
Added new grant_type 'PASSWORD' in the block comment for it to be ins…
alain-charles d69d633
Merge remote-tracking branch 'upstream/master'
alain-charles 1be8d91
Add the refreshtoken request management in NbJwtInterceptor and NbAut…
alain-charles 4b67825
Merge branch 'master' of https://github.com/alain-charles/nebular
alain-charles deea3e2
Merge branch 'master' into temp
alain-charles acd0241
The token now contains ownerStrategyName, with is a back link to the …
alain-charles 25250f0
feature/auth:
alain-charles c0fdd31
feature/auth:
alain-charles bd564b3
feature/auth:
alain-charles 44ed61a
Merge branch 'master' into master
nnixaa 9c16387
feature/auth
alain-charles 2dd26c4
Merge remote-tracking branch 'origin/master'
alain-charles b284377
Merge branch 'master' into master
alain-charles e462c7d
feature/auth
alain-charles a3ee10b
Merge branch 'master' into master
nnixaa b38ae55
Merge branch 'master' into master
nnixaa 62a2aff
feature/auth
alain-charles 66ca493
Merge remote-tracking branch 'origin/master'
alain-charles 3bd5a50
feature/auth
alain-charles 398c058
feature/auth
alain-charles ee706d3
Merge branch 'master' into master
alain-charles 5eb5821
feature/auth
alain-charles 1a08225
Merge remote-tracking branch 'origin/master'
alain-charles 1d697bc
feature/auth
alain-charles 1c25956
Merge remote-tracking branch 'upstream/master'
alain-charles ff0e8d3
Merge remote-tracking branch 'upstream/master'
alain-charles e7af99e
Optimized getAccessTokenPayload() calls
alain-charles 95632b1
Optimized getAccessTokenPayload() calls
alain-charles bc4001f
Merge branch 'master' into master
nnixaa e06a45c
Feat/auth
alain-charles 7c6fc43
Merge remote-tracking branch 'upstream/master' into feat/auth-Automat…
alain-charles 88c7106
Moved code from tokenservice to strategy.
alain-charles 76dda02
Added setRefreshToken(token)
alain-charles 10d0b31
oAuth2Strategy : Move refreshToken creation into independant method
alain-charles f6ba089
Merge branch 'master' into feat/auth-AutomaticRefreshToken
nnixaa c88b96e
Merge branch 'master' into feat/auth-AutomaticRefreshToken
nnixaa b3eb264
refactor(token): generic type for `createToken` method
nnixaa a491f21
Merge pull request #1 from nnixaa/alain-charles-feat/auth-AutomaticRe…
alain-charles 0ae51f6
added parameter type = NbAuthToken in exported const NB_AUTH_TOKENS.
alain-charles File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we can leave this check as:
as we can only have the
NbAuthRefreshableToken
token here, which presumes that both required get and set method exist because this method could only be called from therefreshToken
one, which cannot be called for a non-refreshable token.In case when the developer forces a call of
refreshToken
method for a non-refreshble token it will be a typescript level error, which is completely fine in this case.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!refreshedToken.getRefreshToken()
does not compile asNbAuthToken
(the return type) does not implement this method.That is the reason why i added the
isNbAuthRefreshableToken(refreshedToken)
testSo what do you prefer :
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alain-charles can we do this:
Sorry not able to check it myself.
If we can't, let's leave it as your current version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alain-charles sorry for the delay, wrote the comment last Thursday but forgot to submit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nnixaa with the intersection type you propose above, the problem remains on
refreshedToken
const refreshedToken = this.createToken(res);
this.createToken(res)
returnsNbAuthToken
that does not implementgetRefreshToken()
.Any other idea ?
Alain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alain-charles something like this probably? https://github.com/alain-charles/nebular/pull/1/files