Skip to content

Commit

Permalink
Fix SECURITY-809
Browse files Browse the repository at this point in the history
  • Loading branch information
fcrespel committed Jun 1, 2018
1 parent 8c79249 commit 25d9521
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/java/org/jenkinsci/plugins/cas/CasSecurityRealm.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.interceptor.RequirePOST;
import org.springframework.security.cas.ServiceProperties;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.AuthenticationEntryPoint;
Expand Down Expand Up @@ -287,7 +288,10 @@ public String getDisplayName() {
return "CAS (Central Authentication Service)";
}

@RequirePOST
public FormValidation doCheckCasServerUrl(@QueryParameter String value) throws IOException, ServletException {
Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);

value = Util.fixEmptyAndTrim(value);
if (value == null)
return FormValidation.error(Messages.CasSecurityRealm_casServerUrl_missingUrl());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<f:entry title="${%casServerUrl}" field="casServerUrl">
<f:textbox />
<f:textbox checkMethod="post" />
</f:entry>
<f:dropdownDescriptorSelector title="${%casProtocol}" field="casProtocol" />
<f:entry title="${%forceRenewal}" field="forceRenewal">
Expand Down

0 comments on commit 25d9521

Please sign in to comment.