-
Notifications
You must be signed in to change notification settings - Fork 8
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
Show error message to OAuth2 user when a matching local account already exists #86
Conversation
Hello, In my need, I want the email address to be the user id for connection. And let the user connect from where ever he wanted if he has the same email. I know PR is not the place to discuss about this point, but I didn't find issue link to the PR. Regards |
Hi Pierre, Thanks for testing the software and joining the conversation, but it's a bit out of topic here.
Can you relocate your comment to one of the suggested places ? |
My bad. To my understanding, France Connect does not recommend to use the email as pivot data. |
9048c29
to
b1ec30c
Compare
1db4c11
to
dbc4a60
Compare
@@ -115,7 +115,7 @@ void testFilter_UseResolved() { | |||
|
|||
filter.filter(exchange, mockChain).block(); | |||
|
|||
verify(mockChain, times(1)).filter(same(exchange)); | |||
verify(mockChain, times(2)).filter(same(exchange)); |
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.
Not much satisfied having to change this, as this test can no longer guarantee that exchange.filter
won't be called twice, even though it is not possible in tested 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.
OK I messed up some things between my local version and this one, here chain.filter(exchange)
is really called twice, which is wrong. So I need to find a way to replace .defaultIfEmpty(chain.filter(exchange))
in gateway/src/main/java/org/georchestra/gateway/security/ResolveGeorchestraUserGlobalFilter.java
by something which calls chain.filter(exchange)
only if it receives an empty stream.
I tried to replace it with .switchIfEmpty(Mono.fromRunnable(() -> chain.filter(exchange)))
which satisfies the test but then I can no longer access any service behind gateway (like /datahub/
) when I'm not logged in, just get an empty 200 response.
Closed and followed by PR#116 after a change of source branch. |
If a user tries to log with OAuth2 and a local account with the same e-mail address already exists, it should be presented a clear error messages about this conflict, and the user should not considered logged in.