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

  • Home
  • SEARCH
  • 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 6760563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:04:43+00:00 2026-05-26T14:04:43+00:00

In Android/Java I have a requirement where with the username and password I hit

  • 0

In Android/Java I have a requirement where with the username and password I hit a particular site and get the reponse.

I am able to get that reponse. But from that response how would I know if I have entered the correct username/password. As I get response for both correct and wrong username/password.

I have response and cookies with me. From these how can I know if wht I have entered is correct username/password.

This is the code that I am using.

HttpGet httpGet = new HttpGet(uri);
httpGet.addHeader("User-Agent", USER_AGENT);
HttpResponse response = httpClient.execute(httpGet, httpContext);

Here in response I am getting the same content for correct and wrong username/password

  • 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-05-26T14:04:44+00:00Added an answer on May 26, 2026 at 2:04 pm

    The server has its logic to deal with in/correct username/password, but typically, this is done via the response body, not the response headers. About the only time the 401 response code is used, is when a site uses domain (NTML) credentials and either they haven’t been supplied or they were incorrect.

    The difference being that NTML authentication is done by the browser, and so it knows how to ask for the username/password, while the more typical forms based authentication is done by the server asking for and then validating the input – the browser really doesn’t understand what kind of request is being made, it is just submitting some form data, and the server then responds to that with some data: for 🙂 or :(. The browser treats both contents the same way.

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

Sidebar

Related Questions

I have to admit that I'm new to Java and Android. db4o seems to
I'm currently working on Mangler's Android implementation. I have a java class that looks
Hi i have a problem i'm not able to solve. In my Android\java application
I have an Android java library that uses some native code. I have added
I have an Android (Java) project that includes some native C/C++ code and I
This requirement came up in my Android app, but it applies to Java in
I have been tasked with porting a large Java codebase to the Android platform.
It seems the java.net.NetworkInterface implementation of android does not have a byte[] getHardwareAddress() method
I am completely new to android, and pretty much a Java newb. I have
Does anyone know of any existing projects that aim to port Android's Java VM

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.