Skip to content

due to Jenkins API changes, authentification doesn't work anymore with only crumb; should add SetCookie in addition to Crumb #52

Description

@VirginiaNutu

I solved the problem in the code by adding a member in IJenkinsContext CookieContainer setCookieHeader {get;}
Modified JenkinsClient

public void UpdateSecurityCrumb()
{
try {
this.setCookieHeader = null;
var cmd = new CrumbGetCommand(this);
cmd.Run();
Crumb = cmd.Result;
this.setCookieHeader = cmd.setCookieHeader;

        }
        catch (Exception error) {
            throw new JenkinsNetException("Failed to retrieve crumb!", error);
        }
    }

and all other classes till JenkinsHttpCommand where I set

request.CookieContainer = setCookieHeader;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions