Making attribute names schema compliant and code cleanup

4.x.x
prabathabey 9 years ago
parent 0cdc139a0b
commit 67e1bfb012

@ -46,8 +46,8 @@ public class AuthenticatorConfig {
this.className = className; this.className = className;
} }
@XmlElementWrapper(name="Parameters", nillable=true) @XmlElementWrapper(name = "Parameters", nillable = true)
@XmlElement(name="Parameter", nillable=false) @XmlElement(name = "Parameter", nillable = false)
public List<Parameter> getParams() { public List<Parameter> getParams() {
return this.params; return this.params;
} }
@ -55,12 +55,13 @@ public class AuthenticatorConfig {
public void setParams(List<Parameter> params) { public void setParams(List<Parameter> params) {
this.params = params; this.params = params;
} }
@XmlRootElement(name="Parameter")
@XmlRootElement(name = "Parameter")
public static class Parameter { public static class Parameter {
private String name; private String name;
private String value; private String value;
@XmlAttribute(name="Name") @XmlAttribute(name = "Name")
public String getName() { public String getName() {
return this.name; return this.name;
} }

@ -78,7 +78,8 @@ public class WebappAuthenticatorFrameworkServiceComponent {
WebappAuthenticatorConfig.init(); WebappAuthenticatorConfig.init();
WebappAuthenticatorRepository repository = new WebappAuthenticatorRepository(); WebappAuthenticatorRepository repository = new WebappAuthenticatorRepository();
for (AuthenticatorConfig config : WebappAuthenticatorConfig.getInstance().getAuthenticators()) { for (AuthenticatorConfig config : WebappAuthenticatorConfig.getInstance().getAuthenticators()) {
WebappAuthenticator authenticator = (WebappAuthenticator)Class.forName(config.getClassName()).newInstance(); WebappAuthenticator authenticator =
(WebappAuthenticator) Class.forName(config.getClassName()).newInstance();
if ((config.getParams() != null) && (!config.getParams().isEmpty())) { if ((config.getParams() != null) && (!config.getParams().isEmpty())) {
Properties properties = new Properties(); Properties properties = new Properties();

@ -4,12 +4,12 @@
<Name>OAuth</Name> <Name>OAuth</Name>
<ClassName>org.wso2.carbon.webapp.authenticator.framework.authenticator.OAuthAuthenticator</ClassName> <ClassName>org.wso2.carbon.webapp.authenticator.framework.authenticator.OAuthAuthenticator</ClassName>
<Parameters> <Parameters>
<Parameter name="IsRemote">true</Parameter> <Parameter Name="IsRemote">true</Parameter>
<Parameter name="TokenValidationEndpointUrl">https://localhost:9443</Parameter> <Parameter Name="TokenValidationEndpointUrl">https://localhost:9443</Parameter>
<Parameter name="Username">admin</Parameter> <Parameter Name="Username">admin</Parameter>
<Parameter name="Password">admin</Parameter> <Parameter Name="Password">admin</Parameter>
<Parameter name="MaxTotalConnections">100</Parameter> <Parameter Name="MaxTotalConnections">100</Parameter>
<Parameter name="MaxConnectionsPerHost">100</Parameter> <Parameter Name="MaxConnectionsPerHost">100</Parameter>
</Parameters> </Parameters>
</Authenticator> </Authenticator>
<Authenticator> <Authenticator>

Loading…
Cancel
Save