Search in sources :

Example 1 with CrumbIssuer

use of hudson.security.csrf.CrumbIssuer in project hudson-2.x by hudson.

the class Functions method getCrumbRequestField.

public static String getCrumbRequestField() {
    Hudson h = Hudson.getInstance();
    CrumbIssuer issuer = h != null ? h.getCrumbIssuer() : null;
    return issuer != null ? issuer.getDescriptor().getCrumbRequestField() : "";
}
Also used : CrumbIssuer(hudson.security.csrf.CrumbIssuer) Hudson(hudson.model.Hudson)

Example 2 with CrumbIssuer

use of hudson.security.csrf.CrumbIssuer in project hudson-2.x by hudson.

the class Functions method getCrumb.

public static String getCrumb(StaplerRequest req) {
    Hudson h = Hudson.getInstance();
    CrumbIssuer issuer = h != null ? h.getCrumbIssuer() : null;
    return issuer != null ? issuer.getCrumb(req) : "";
}
Also used : CrumbIssuer(hudson.security.csrf.CrumbIssuer) Hudson(hudson.model.Hudson)

Aggregations

Hudson (hudson.model.Hudson)2 CrumbIssuer (hudson.security.csrf.CrumbIssuer)2