-
Notifications
You must be signed in to change notification settings - Fork 22
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
Duplicate auth id fix #1186
base: v2.1
Are you sure you want to change the base?
Duplicate auth id fix #1186
Conversation
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.
The configs module changes are not part of this fix.
|
||
@Override | ||
public void storeAccessToken(final OAuth2AccessToken token, final OAuth2Authentication authentication) { | ||
final String key = authenticationKeyGenerator.extractKey(authentication); |
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.
Check for null authentication
.
@Override | ||
public void storeAccessToken(final OAuth2AccessToken token, final OAuth2Authentication authentication) { | ||
final String key = authenticationKeyGenerator.extractKey(authentication); | ||
jdbcTemplate.update("delete from oauth_access_token where authentication_id = ?", key); |
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.
Check for null on key
.
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.
Log info when jdbcTemplate.update("delete from oauth_access_token where authentication_id = ?", key);
eventually finds a duplicate and deletes it.
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.
Update snapshot version
return new JdbcTokenStore(dataSource) { | ||
|
||
@Override | ||
public void storeAccessToken(final OAuth2AccessToken token, final OAuth2Authentication authentication) { | ||
final String key = authenticationKeyGenerator.extractKey(authentication); | ||
jdbcTemplate.update("delete from oauth_access_token where authentication_id = ?", key); | ||
if( key == null || authentication == null) |
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 think the check for authentication needs to happen before passing the
authentication
object to the function - Evaluate and see if super needs to be called even if we skip the delete operation
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.
super needs to be called since it is mostly operating on the OAuth2AccessToken token
.
…rver-web into duplicate-auth-id-fix
update version code
@Override | ||
public void storeAccessToken(final OAuth2AccessToken token, final OAuth2Authentication authentication) { | ||
|
||
if( authentication != null){ |
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.
Nitpick: Formatting here and line 103
…rver-web into duplicate-auth-id-fix
No description provided.