public void updateConfigurations(Property[] configurations) throws IdentityGovernanceException { String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); identityGovernanceService = new IdentityGovernanceServiceImpl(); Map<String, String> confMap = new HashMap<>(); for (Property configuration : configurations) { confMap.put(configuration.getName(), configuration.getValue()); } identityGovernanceService.updateConfiguration(tenantDomain, confMap); }
/** * @param externalIdPConfig * @param name * @return */ public static Map<String, String> getAuthenticatorPropertyMapFromIdP( ExternalIdPConfig externalIdPConfig, String name) { Map<String, String> propertyMap = new HashMap<String, String>(); if (externalIdPConfig != null) { FederatedAuthenticatorConfig[] authenticatorConfigs = externalIdPConfig.getIdentityProvider().getFederatedAuthenticatorConfigs(); for (FederatedAuthenticatorConfig authenticatorConfig : authenticatorConfigs) { if (authenticatorConfig.getName().equals(name)) { for (Property property : authenticatorConfig.getProperties()) { propertyMap.put(property.getName(), property.getValue()); } break; } } } return propertyMap; }
/** * Get Configuration Properties * * @return */ @Override public List<Property> getConfigurationProperties() { List<Property> configProperties = new ArrayList<Property>(); Property clientId = new Property(); clientId.setName(OIDCAuthenticatorConstants.CLIENT_ID); clientId.setDisplayName("Client Id"); clientId.setRequired(true); clientId.setDescription("Enter Google IDP client identifier value"); configProperties.add(clientId); Property clientSecret = new Property(); clientSecret.setName(OIDCAuthenticatorConstants.CLIENT_SECRET); clientSecret.setDisplayName("Client Secret"); clientSecret.setRequired(true); clientSecret.setConfidential(true); clientSecret.setDescription("Enter Google IDP client secret value"); configProperties.add(clientSecret); Property callbackUrl = new Property(); callbackUrl.setDisplayName("Callback Url"); callbackUrl.setName(GoogleOAuth2AuthenticationConstant.CALLBACK_URL); callbackUrl.setRequired(true); callbackUrl.setDescription("Enter value corresponding to callback url."); configProperties.add(callbackUrl); Property oauthEndpoint = new Property(); oauthEndpoint.setDisplayName("Google Oauth Endpoint"); oauthEndpoint.setName(GoogleOAuth2AuthenticationConstant.GOOGLE_OAUTH_ENDPOINT); oauthEndpoint.setValue(IdentityApplicationConstants.GOOGLE_OAUTH_URL); oauthEndpoint.setDescription("Enter value corresponding to google oauth endpoint."); configProperties.add(oauthEndpoint); Property tokenEndpoint = new Property(); tokenEndpoint.setDisplayName("Google Token Endpoint"); tokenEndpoint.setName(GoogleOAuth2AuthenticationConstant.GOOGLE_TOKEN_ENDPOINT); tokenEndpoint.setValue(IdentityApplicationConstants.GOOGLE_TOKEN_URL); tokenEndpoint.setDescription("Enter value corresponding to google token endpoint."); configProperties.add(tokenEndpoint); Property userInfoEndpoint = new Property(); userInfoEndpoint.setDisplayName("Google User Info Endpoint"); userInfoEndpoint.setName(GoogleOAuth2AuthenticationConstant.GOOGLE_USERINFO_ENDPOINT); userInfoEndpoint.setValue(IdentityApplicationConstants.GOOGLE_USERINFO_URL); userInfoEndpoint.setDescription("Enter value corresponding to google user info endpoint."); configProperties.add(userInfoEndpoint); return configProperties; }
/** Get the configuration properties of UI */ @Override public List<Property> getConfigurationProperties() { List<Property> configProperties = new ArrayList<Property>(); Property serviceId = new Property(); serviceId.setName(InweboConstants.SERVICE_ID); serviceId.setDisplayName("Service Id"); serviceId.setRequired(true); serviceId.setDescription("Enter your service id"); configProperties.add(serviceId); Property p12file = new Property(); p12file.setName(InweboConstants.INWEBO_P12FILE); p12file.setDisplayName("Certificate File"); p12file.setRequired(true); p12file.setDescription("Enter your p12_file path"); configProperties.add(p12file); Property p12password = new Property(); p12password.setName(InweboConstants.INWEBO_P12PASSWORD); p12password.setDisplayName("Certificate Password"); p12password.setRequired(true); p12password.setConfidential(true); p12password.setDescription("Enter your p12_password"); configProperties.add(p12password); Property retryCount = new Property(); retryCount.setName(InweboConstants.RETRY_COUNT); retryCount.setDisplayName("Waiting Time"); retryCount.setDescription("Waiting time for authentication in seconds(<10)"); configProperties.add(retryCount); Property retryInterval = new Property(); retryInterval.setName(InweboConstants.RETRY_INTERVAL); retryInterval.setDisplayName("Retry Interval"); retryInterval.setDescription("Retrying time interval in ms(eg 1000)"); configProperties.add(retryInterval); return configProperties; }