Skip to content

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

@VirginiaNutu

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;

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