KEYCLOAK-86 social registration fix
This commit is contained in:
parent
07ce446e96
commit
a80cc22f97
2 changed files with 15 additions and 0 deletions
|
@ -34,6 +34,16 @@ public class UrlBean {
|
||||||
|
|
||||||
private RealmBean realm;
|
private RealmBean realm;
|
||||||
|
|
||||||
|
private boolean socialRegistration;
|
||||||
|
|
||||||
|
public boolean isSocialRegistration() {
|
||||||
|
return socialRegistration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSocialRegistration(boolean socialRegistration) {
|
||||||
|
this.socialRegistration = socialRegistration;
|
||||||
|
}
|
||||||
|
|
||||||
public UrlBean(RealmBean realm, URI baseURI){
|
public UrlBean(RealmBean realm, URI baseURI){
|
||||||
this.realm = realm;
|
this.realm = realm;
|
||||||
this.baseURI = baseURI;
|
this.baseURI = baseURI;
|
||||||
|
@ -82,6 +92,8 @@ public class UrlBean {
|
||||||
public String getRegistrationAction() {
|
public String getRegistrationAction() {
|
||||||
if (realm.isSaas()) {
|
if (realm.isSaas()) {
|
||||||
return Urls.saasRegisterAction(baseURI).toString();
|
return Urls.saasRegisterAction(baseURI).toString();
|
||||||
|
} else if (socialRegistration){
|
||||||
|
return Urls.socialRegisterAction(baseURI, realm.getId()).toString();
|
||||||
} else {
|
} else {
|
||||||
return Urls.realmRegisterAction(baseURI, realm.getId()).toString();
|
return Urls.realmRegisterAction(baseURI, realm.getId()).toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,6 +169,7 @@ public class FormServiceImpl implements FormService {
|
||||||
attributes.put("realm", realm);
|
attributes.put("realm", realm);
|
||||||
|
|
||||||
UrlBean url = new UrlBean(realm, dataBean.getBaseURI());
|
UrlBean url = new UrlBean(realm, dataBean.getBaseURI());
|
||||||
|
url.setSocialRegistration(dataBean.getSocialRegistration());
|
||||||
|
|
||||||
attributes.put("url", url);
|
attributes.put("url", url);
|
||||||
attributes.put("user", new UserBean(dataBean.getUserModel()));
|
attributes.put("user", new UserBean(dataBean.getUserModel()));
|
||||||
|
@ -213,6 +214,7 @@ public class FormServiceImpl implements FormService {
|
||||||
attributes.put("realm", realm);
|
attributes.put("realm", realm);
|
||||||
|
|
||||||
UrlBean url = new UrlBean(realm, dataBean.getBaseURI());
|
UrlBean url = new UrlBean(realm, dataBean.getBaseURI());
|
||||||
|
url.setSocialRegistration(dataBean.getSocialRegistration());
|
||||||
|
|
||||||
attributes.put("url", url);
|
attributes.put("url", url);
|
||||||
attributes.put("user", new UserBean(dataBean.getUserModel()));
|
attributes.put("user", new UserBean(dataBean.getUserModel()));
|
||||||
|
@ -236,6 +238,7 @@ public class FormServiceImpl implements FormService {
|
||||||
attributes.put("realm", realm);
|
attributes.put("realm", realm);
|
||||||
|
|
||||||
UrlBean url = new UrlBean(realm, dataBean.getBaseURI());
|
UrlBean url = new UrlBean(realm, dataBean.getBaseURI());
|
||||||
|
url.setSocialRegistration(dataBean.getSocialRegistration());
|
||||||
|
|
||||||
attributes.put("url", url);
|
attributes.put("url", url);
|
||||||
attributes.put("user", new UserBean(dataBean.getUserModel()));
|
attributes.put("user", new UserBean(dataBean.getUserModel()));
|
||||||
|
|
Loading…
Reference in a new issue