-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Add Reactive One-Time Token Login support #15792
base: main
Are you sure you want to change the base?
Conversation
8b98205
to
c462b5a
Compare
c462b5a
to
4a97864
Compare
4a97864
to
38210a9
Compare
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.
Thanks @CrazyParanoid. I've left some feedback inline.
In addition to that, would you please add documentation based on the existing servlet docs? If you don't have time to do that, can you please create a ticket?
@@ -244,7 +253,7 @@ | |||
* } | |||
* } | |||
* </pre> | |||
* | |||
* <p> |
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.
Could you please not change those extra lines, paragraphs, white lines etc? They are only creating extra noise
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.
Sorry, fixed.
catch (Throwable ex) { | ||
return Mono.error(ex); | ||
} |
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.
Since Error
extends Throwable
, I think catching an Exception
would be better here.
if (this.oneTimeTokenService == null) { | ||
this.oneTimeTokenService = new InMemoryReactiveOneTimeTokenService(); | ||
} | ||
return this.oneTimeTokenService; |
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.
You can probably initialize the oneTimeTokenService
field with InMemoryReactiveOneTimeTokenService
and remove this method
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 added initialization of oneTimeTokenService
with InMemoryReactiveOneTimeTokenService
, but I left the getOneTimeTokenService
method in order to be able to get oneTimeTokenService
as a bean.
if (this.authenticationConverter == null) { | ||
return new ServerOneTimeTokenAuthenticationConverter(); | ||
} | ||
return this.authenticationConverter; |
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.
You can probably initialize the authenticationConverter
field with ServerOneTimeTokenAuthenticationConverter
and remove this method
private ServerGeneratedOneTimeTokenHandler generatedOneTimeTokenHandler = new ServerRedirectGeneratedOneTimeTokenHandler( | ||
"/login/ott"); | ||
|
||
public GenerateOneTimeTokenWebFilter(ReactiveOneTimeTokenService oneTimeTokenService) { |
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.
Can you please require the ServerGeneratedOneTimeTokenHandler
in the constructor? Like a88a774
23656ee
to
f5d2dfb
Compare
Hi @marcusdacoregio. Thanks for your feedback! All your comments have been resolved. |
b37abb9
to
8744faf
Compare
8744faf
to
d2a9e72
Compare
Hi @marcusdacoregio ! I have resolved all errors and conflicts and added documentation. Could you please review it? |
Closes gh-15699