Merge pull request #56 from vrockai/KEYCLOAK-86
KEYCLOAK-86 social registration fix
This commit is contained in:
commit
313b791939
2 changed files with 15 additions and 0 deletions
|
@ -34,6 +34,16 @@ public class UrlBean {
|
|||
|
||||
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){
|
||||
this.realm = realm;
|
||||
this.baseURI = baseURI;
|
||||
|
@ -82,6 +92,8 @@ public class UrlBean {
|
|||
public String getRegistrationAction() {
|
||||
if (realm.isSaas()) {
|
||||
return Urls.saasRegisterAction(baseURI).toString();
|
||||
} else if (socialRegistration){
|
||||
return Urls.socialRegisterAction(baseURI, realm.getId()).toString();
|
||||
} else {
|
||||
return Urls.realmRegisterAction(baseURI, realm.getId()).toString();
|
||||
}
|
||||
|
|
|
@ -169,6 +169,7 @@ public class FormServiceImpl implements FormService {
|
|||
attributes.put("realm", realm);
|
||||
|
||||
UrlBean url = new UrlBean(realm, dataBean.getBaseURI());
|
||||
url.setSocialRegistration(dataBean.getSocialRegistration());
|
||||
|
||||
attributes.put("url", url);
|
||||
attributes.put("user", new UserBean(dataBean.getUserModel()));
|
||||
|
@ -213,6 +214,7 @@ public class FormServiceImpl implements FormService {
|
|||
attributes.put("realm", realm);
|
||||
|
||||
UrlBean url = new UrlBean(realm, dataBean.getBaseURI());
|
||||
url.setSocialRegistration(dataBean.getSocialRegistration());
|
||||
|
||||
attributes.put("url", url);
|
||||
attributes.put("user", new UserBean(dataBean.getUserModel()));
|
||||
|
@ -236,6 +238,7 @@ public class FormServiceImpl implements FormService {
|
|||
attributes.put("realm", realm);
|
||||
|
||||
UrlBean url = new UrlBean(realm, dataBean.getBaseURI());
|
||||
url.setSocialRegistration(dataBean.getSocialRegistration());
|
||||
|
||||
attributes.put("url", url);
|
||||
attributes.put("user", new UserBean(dataBean.getUserModel()));
|
||||
|
|
Loading…
Reference in a new issue