LOGIN_REQUIRED failures return an HTML page to WebService clients

RESOLVED WORKSFORME

Status

()

Bugzilla
WebService
RESOLVED WORKSFORME
10 years ago
9 years ago

People

(Reporter: Max Kanat-Alexander, Unassigned)

Tracking

Bug Flags:
blocking3.2 -
blocking3.0.5 -

Details

(Reporter)

Description

10 years ago
Instead of throwing an error, the WebService returns the login screen to XML-RPC clients when they try to use a REQUIRE_LOGIN method without being logged in.
Flags: blocking3.2+
Flags: blocking3.0.5+

Comment 1

10 years ago
I would like to work on this bug but have a couple questions:

1. Do you mean login type == LOGIN_REQUIRED? I do not see REQUIRE_LOGIN.
2. Also I currently get a proper error message when trying to create a new bug via XMLRPC and not providing a session token. The message "Login Required" is returned as the fault string.

Looking in  Bugzilla/Auth/Login/CGI.pm I see:

sub fail_nodata {
    my ($self) = @_;
    my $cgi = Bugzilla->cgi;
    my $template = Bugzilla->template;

    if (Bugzilla->error_mode == Bugzilla::Constants::ERROR_MODE_DIE_SOAP_FAULT) {
        die SOAP::Fault
            ->faultcode(ERROR_AUTH_NODATA)
            ->faultstring('Login Required');
    }

    # Redirect to SSL if required
    if (Bugzilla->params->{'sslbase'} ne ''
        and Bugzilla->params->{'ssl'} ne 'never')
    {
        $cgi->require_https(Bugzilla->params->{'sslbase'});
    }
    print $cgi->header();
    $template->process("account/auth/login.html.tmpl",
                       { 'target' => $cgi->url(-relative=>1) })
        || ThrowTemplateError($template->error());
    exit;
}

So it seems that for me at least the right thing is happening. Can you be more exact in what you were trying when you got the html login screen instead?

Thanks
Dave
Flags: needsinfo?(mkanat)
(Reporter)

Comment 2

10 years ago
(In reply to comment #1)
> 1. Do you mean login type == LOGIN_REQUIRED? I do not see REQUIRE_LOGIN.

  I do.

> 2. Also I currently get a proper error message when trying to create a new bug
> via XMLRPC and not providing a session token. The message "Login Required" is
> returned as the fault string.

  Hmm, I actually get that too, but not always. Don't know what triggers getting a webpage.

> So it seems that for me at least the right thing is happening. Can you be more
> exact in what you were trying when you got the html login screen instead?

  Don't recall--I'll let you know if/when it happens again.
Flags: needsinfo?(mkanat)
Flags: blocking3.2-
Flags: blocking3.2+
Flags: blocking3.0.5-
Flags: blocking3.0.5+

Updated

10 years ago
Summary: REQUIRE_LOGIN failures return an HTML page to WebService clients → LOGIN_REQUIRED failures return an HTML page to WebService clients

Comment 3

10 years ago
Should we leave this bug open? or close it and reopen when the problem reoccurs?

Dave
(Reporter)

Comment 4

10 years ago
Oh, let's say it's WFM for now and if it happens again I'll reopen it.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → WORKSFORME

Updated

9 years ago
Target Milestone: Bugzilla 3.0 → ---
You need to log in before you can comment on or make changes to this bug.