Skip to content
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

CLOUDSTACK-10101: Present the full domain name when listing user's domains in SAML2 plugin #2280

Merged
merged 1 commit into from
Oct 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public String authenticate(final String command, final Map<String, Object[]> par
accountResponse.setUserName(user.getUsername());
accountResponse.setDomainId(domain.getUuid());
accountResponse.setDomainName(domain.getName());
accountResponse.setDomainPath(domain.getPath());
accountResponse.setAccountName(userAccount.getAccountName());
accountResponse.setIdpId(user.getExternalEntity());
accountResponses.add(accountResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public class SamlUserAccountResponse extends AuthenticationCmdResponse {
@Param(description = "The IDP ID")
private String idpId;

@SerializedName("domainPath")
@Param(description = "The full qualified domain path")
private String domainPath;

public SamlUserAccountResponse() {
super();
setObjectName("samluseraccount");
Expand Down Expand Up @@ -96,4 +100,13 @@ public String getIdpId() {
public void setIdpId(String idpId) {
this.idpId = idpId;
}

public String getDomainPath() {
return domainPath;
}

public void setDomainPath(String domainPath) {
this.domainPath = domainPath;
}

}
5 changes: 4 additions & 1 deletion ui/scripts/ui-custom/saml.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@
option.data("userId", accounts[i].userId);
option.data("domainId", accounts[i].domainId);
option.val(accounts[i].userId + '/' + accounts[i].domainId);
option.html(accounts[i].accountName + "/" + accounts[i].domainName);
option.html(accounts[i].accountName + accounts[i].domainPath);
if (accounts[i].domainName == 'ROOT') {
option.append('ROOT');
}
option.appendTo($domainSelect);
}
var currentAccountDomain = g_userid + '/' + g_domainid;
Expand Down