mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-10 15:32:05 -03:30
If registration is not allowed for a realm it should not be possible to login with social login unless the user already exists
This commit is contained in:
parent
0301094fc9
commit
a65c8695d7
@ -144,6 +144,10 @@ public class SocialResource {
|
||||
UserModel user = realm.getUser(provider.getId() + "." + socialUser.getId());
|
||||
|
||||
if (user == null) {
|
||||
if (!realm.isRegistrationAllowed()) {
|
||||
return oauth.forwardToSecurityFailure("Registration not allowed");
|
||||
}
|
||||
|
||||
user = realm.addUser(provider.getId() + "." + socialUser.getId());
|
||||
user.setAttribute(provider.getId() + ".id", socialUser.getId());
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user