Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8515615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:11:50+00:00 2026-06-11T05:11:50+00:00

I got a fairly simple WinJS Metro app which gets asks the user for

  • 0

I got a fairly simple WinJS Metro app which gets asks the user for a username and password before getting some JSON-data from a webservice.

I use jQuery.ajax() to get the data, and i set the basic authentication header correctly. However, if the user enters incorrect credentials, and the server returns a 401, the metro runtime displays a login screen. The error handler passed to the jQuery.ajax() function isn’t called unless the user presses “cancel” on the runtime provided login screen.

I want the program to handle failed login attempts, is there a way to suppress the runtime logon screen?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:11:51+00:00Added an answer on June 11, 2026 at 5:11 am

    Not sure what you’re doing, but the following code properly triggers the error handler if the user provides the wrong username/password:

        var userInfo = getCurrentUserInfo();
        $.ajax({
            url: URL,
            dataType: 'json',
            success: jsonCallback,
            username: userInfo.username,
            password: userInfo.password,
            error: function (jqXHR, textStatus, errorThrown) {
                errorHandler(jqXHR, textStatus, errorThrown);
            }
        }
    

    Are you providing the username/password on your own, or waiting for the system’s login dialog to come up? I’m afraid once it comes up, there’s no getting back to your code until the user cancels, like you say.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a fairly complex web app which I've condensed down to the following
I've got a fairly simple treeview where the nodes are PopulateOnDemand and some of
I've got a c# windows form app I threw together. It's fairly simple:\ inputs:
I've got a fairly simple method which recursively removes begining/ending html tags class Program
I'm trying to do something fairly simple. I've got a div tag in which
I've got a fairly simple NodeJS app that is nothing but a shell that
I've got a fairly simple table which stores the records' authors in a text
Building an application which started as fairly simple, but now got pretty complicated. I
I've got a fairly simple loop that supposed to run through all elements in
I've got a fairly simple, but potentially large structure to serialize. Basically the structure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.