use of org.gluu.model.passport.idpinitiated.AuthzParams in project oxTrust by GluuFederation.
the class PassportIdpInitiatedAction method activateForm.
public void activateForm() {
this.authzParam = new AuthzParams();
this.authzParam.setRedirectUri(getSamlUrl());
this.showForm = true;
}
use of org.gluu.model.passport.idpinitiated.AuthzParams in project oxTrust by GluuFederation.
the class PassportIdpInitiatedAction method updateClientRedirects.
private void updateClientRedirects() {
List<String> total = new ArrayList<>();
List<String> urls = new ArrayList<>();
for (AuthzParams param : this.iiConfiguration.getAuthorizationParams()) {
if (param.getRedirectUri() != null) {
urls.add(param.getRedirectUri().trim());
}
}
OxAuthClient client = clientService.getClientByInum(this.iiConfiguration.getOpenidclient().getClientId());
List<String> existingUrls = client.getOxAuthRedirectURIs();
if (existingUrls != null) {
total.addAll(existingUrls);
total.addAll(urls);
Set<String> set = new HashSet<String>(total);
client.setOxAuthRedirectURIs(new ArrayList<String>(set));
} else {
client.setOxAuthRedirectURIs(existingUrls);
}
clientService.updateClient(client);
}
use of org.gluu.model.passport.idpinitiated.AuthzParams in project oxTrust by GluuFederation.
the class PassportIdpInitiatedAction method addAuthParam.
public void addAuthParam() {
StringBuilder scopesBuilder = new StringBuilder();
scopes.forEach(e -> {
scopesBuilder.append(e);
scopesBuilder.append(" ");
});
StringBuilder typesBuilder = new StringBuilder();
responseTypes.forEach(e -> {
typesBuilder.append(e);
typesBuilder.append(" ");
});
if (isValid()) {
this.authzParam.setScopes(scopesBuilder.toString().trim());
this.authzParam.setResponseType(typesBuilder.toString().trim());
this.authzParam.setExtraParams(options.stream().filter(e -> e.getKey() != null).collect(Collectors.toMap(OptionEntry::getKey, OptionEntry::getValue)));
if (this.isEdition) {
this.authzParams.remove(this.previousParam);
this.authzParams.add(this.authzParam);
} else {
this.authzParams.add(this.authzParam);
}
this.showForm = false;
this.isEdition = false;
this.authzParam = new AuthzParams();
this.previousParam = null;
this.options.clear();
save();
} else {
facesMessages.add(FacesMessage.SEVERITY_ERROR, "All fields are required.");
}
}
use of org.gluu.model.passport.idpinitiated.AuthzParams in project oxTrust by GluuFederation.
the class PassportIdpInitiatedAction method cancelParamAdd.
public void cancelParamAdd() {
this.scopes = new ArrayList<>();
this.responseTypes = new ArrayList<>();
this.authzParam = new AuthzParams();
this.showForm = false;
this.previousParam = null;
this.options.clear();
}
Aggregations