Search in sources :

Example 6 with OptionEntry

use of org.gluu.oxtrust.model.OptionEntry 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.");
    }
}
Also used : OptionEntry(org.gluu.oxtrust.model.OptionEntry) AuthzParams(org.gluu.model.passport.idpinitiated.AuthzParams)

Aggregations

OptionEntry (org.gluu.oxtrust.model.OptionEntry)6 Provider (org.gluu.model.passport.Provider)3 PassportProvider (org.gluu.oxtrust.model.PassportProvider)3 AuthzParams (org.gluu.model.passport.idpinitiated.AuthzParams)1