How can I login to a site that is .htaccess password protected with java

Forgive me if this is a dumb question. I am have never done this before and haven't been able to find out how to do this. I want to send some xml (passportRequest) to a server that is listening. The hard part is this server is password protected with htaccess. I have the username and password and I tried adding it to the url (ie https://user:password@server....) but not luck. I read somewhere that I can't do that anymore...is that right? I tried the code below but no luck there either. Any of you guys have any tutorials you could point me to or suggestions? Thanks!
String urlStr = "https://www.myserver.com/pathto/requestlistener";
URL url = new URL(urlStr);
HttpURLConnection con = (HttpURLConnection)url.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-type", "application/x-www-form-urlencoded");
con.setRequestProperty("reqData", passportRequest);
sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
String encryptedPassword = encoder.encode((customerId+":"+password).getBytes());
con.setRequestProperty("Authorization", encryptedPassword);

con.setRequestProperty("Authorization", "Basic " +
encryptedPassword);should do the trick.AWESOME! I was so close. Thanks for the tip. Does
"Basic" just tell the server what type of
authentication to use? What are the other options
available? Where can I learn more about this stuff?
I figured it was something simple like that, but when
no one responded I was beginning to wonder if it was
possible. I didn't know why it would be (its setting
headers and that shouldn't matter where you are doing
it from, browser or code). Thanks again!All of this (including what you have to supply to log in from any client, Java or not) is in the information that the first link in my previous post displays. However - you have to read it.

Similar Messages

  • How can I block bogus web site that keeps trying to update firefox? Need to identify bogus site too.

    How can I block bogus web site that keeps trying to update firefox? Need to identify bogus site too.

    hello, this is a scam tactic that is trying to trick you into installing malware, so don't download or execute this kind of stuff - updates are handled automatically by firefox so you don't have to download anything (you can always initiate a manual check for updates in ''firefox > help > about firefox'').
    you might also want to run a full scan of your system with the security software already in place and different tools like the [http://www.malwarebytes.org/products/malwarebytes_free free version of malwarebytes], [http://www.bleepingcomputer.com/download/adwcleaner/ adwcleaner] & [http://www.kaspersky.com/security-scan kaspersky security scan] in order to make sure that there isn't already some sort of malware active on your system that triggers these false alerts.
    [[Troubleshoot Firefox issues caused by malware]]
    you could also help by pressing F10 & going to ''help > report web forgery'' while you're on this dubious page - this might get the page into the list of malicious sites that get blocked in firefox (the actual list is maintained by google) or when such pages use the firefox logos or trademarks to trick users into downloading malware you could also file it at https://www.mozilla.org/en-US/legal/fraud-report/.

  • How can one copy/play a cd that seems to be protected

    how can one copy/play a cd that seems to be protected. Is this always the case with compilation cd's? I cannot play, read or copy on my windows7 PC.

    Daeldel wrote:
    how can one copy/play a cd that seems to be protected. Is this always the case with compilation cd's? I cannot play, read or copy on my windows7 PC.
    There are still many CDs around that are designed to make it difficult to rip, especially those from the Warner Brothers group.
    Some that will not rip on a Windows machine will do OK on a Mac.  If you have access to a Mac try it there, and bring the resulting MP3s back to your Windows machine on a flash drive so you can add them to your iTunes library.

  • How can I access a web site that is blocked?

    The website listed below is blocked. How can I access it?

    https://webinar.cms.hhs.gov/e13581911/event/event_info.html <br />
    Loads for me. What indication do you get that it is blocked?

  • How can I refresh a web site that I use often but it also changes its content frequently. Where is the refresh icon?

    I use to refresh my browser & web pages by clicking on the "refresh" button. This button is no longer on my browser. how can I refresh a web page or keep it up to date if there is no refresh icon to use.?

    Firefox 4 and later use a combined Stop/Reload/Go button that is positioned at the right end of the location bar.<br />
    During the page load process it shows as a Stop button and after the loading has finished the button is changed to a Reload button.<br />
    If you type in the location bar then that button becomes a Go button.<br />
    Middle-click the Reload button to duplicate the current tab to a new tab.<br />
    *https://support.mozilla.com/kb/common-questions-after-updating-firefox

  • Since clearing chase, cookies and history I can NOT access my regular sites that require a password. I know these sites work with my passwaord becuse I've visited them on my other computer(s).

    I was having difficulty accessing usual sites like LinkedIn.com, FaceBook.com, OKCupid.com that require a password. At one attempt to log on it was suggested that I clear all cashe, history, and cookies and try again. That made matters worse. I decided to DELETE Fire Fox 3.6.15 version and when I went to Mozilla dot com I saw this 4.0 version. I installed it and I am still having the same problems. My usual sites do not recognize my passwords. I can access these sites on other computers, just not mine. Yes, I tried using other browsers to no avail. I need HELP fast!
    [email protected]

    If clearing the cookies doesn't help then it is possible that the file <i>cookies.sqlite</i> that stores the cookies is corrupted.
    Rename (or delete) <b>cookies.sqlite</b> (cookies.sqlite.old) and delete <b>cookies.sqlite-journal</b> and <b>cookies.txt</b>, if they exist, in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder] in case the file cookies.sqlite got corrupted.
    * http://kb.mozillazine.org/Cookies#Removing_cookies

  • I can not login into a site that previously i could

    Hello, When I registered for login to the Enridge account
    https://www.enbridgegas.com/myEnbridge/login.aspx
    I could enter my email address and Firefox remembered it. Also, the password was remembered and i could login. For the last few days it does not remember my login email address even though I checked the box that asks it to remember. It remembers the password but I cannot log in it keeps telling me "The username or password you entered is not on file, please try again". I have no problem logging in with Internet Explorer with the same email address and password, I prefer to use Firefox where all my bookmarks are. Something changes with my Firefox and i can't figure out what. Please help
    Thanks
    Abraham Shalev

    Is there a button to click instead of pressing Enter? If so, try that. The computer may be trying to correct your typing.

  • How can i replace an apple id that uses a gmail account with my icloud address?

    Greetings,
    I have an Apple ID that uses a gmail address, which i used to create an iCloud email account. However, I cannot seem to replace my gmail Apple ID with the iCloud address. Is it possible to separate the iCloud email from the gmail address, and make it my only Apple ID i.e. can i scrap the gmail ID and only use my iCloud username as my ID?
    Kim

    I'm afraid you can't do this. You can change the ID to another non-Apple address, but you can't make your @icloud.com address the ID.

  • How can I delete topic index keywords that are no longer associated with a topic?

    I am trying to clean up the index of an older Robohelp project before it becomes part of a merged webhelp project. I do not want to include any of its index keywords or topic keywords. I've managed to remove most of them, but I have a group of troublesome entries that refuse to go away. In fact, they cause RH8 to crash. I am running Windows XP.
    Looking at the code in Visual Studio, it appears that an instruction is pointing to field which contains "zero".  (see image below) 
    I have tried creating a new index and deleting the old index, but RH just keeps adding these topic keywords (in bold typeface) to the new index. If the keywords are no longer associated with a topic, where is RH storing these disassociated keywords? If I open the .hhk, it is empty.

    Not sure why RH crashed when deleting a portion of the topic keywords manuall
    y from the index pane, but I was finally able to remove them with the Remove Unused Keywords tool. Duh! Thanks anyway!

  • How can I connect to a WLAN, that requires Userid/Password to connect?

    At a recent conference I tried to used my ATV 3 and Airplay to present on the video projector. My ATV 3 found the WLAN and connected, but in order to get internet access this WLAN required to enter a userid/password.
    On a PC the UI to enter this data comes up, when you try to open any kind of web page. ´
    I did not manage to logon using the Apple TV 3. Any hints?

    No way to join from the ATV.  The way I have gotten around this in the past is to sign in to the network on my Mac then turn on internet sharing in system preferences and create an ad hoc network that i then join with the ATV.

  • How can I obtain the web site template of the ''Imvelo Safari Lodges'' that appears on the Site of the day web page?

    How can I obtain the web site template of the ''Imvelo Safari Lodges'' that appears on the Site of the day web page?

    Hi Ginette,
    The site that you are referring to does not appear to be a template that you can get your hands on, however, I will suggest that you contact the owner via their contact us page and see what can be done.
    - Abhishek Maurya

  • How can I login and retrieve my user file from the trash?

    I was trying to find out where all my HD had gone, which a did using ‘What Size’.
    I found what looked like an old backup file so I put the file in the trash.
    It turns out that the file was my user file. So now I can’t login to as the user.
    How can I login and retrieve my user file from the trash?

    The Digital Editions forum is here, in case this is what you are talking about:
    http://forums.adobe.com/community/adobe_digital_editions
    If you are not, I apologize for the misunderstanding.

  • HT5622 How can I Login to my iTunes stores

    How can I login to my iTunes stores

    Why didn't you say that from the start? 
    If you think you broke your arm, do you tell the doctor your car won't start?    No, you tell the doctor you can't drive because your arm won't work, you think it's broken.
    You have to enter a method of payment, even for free apps.  
    This link is to acceptable payment methods:
    http://support.apple.com/kb/HT5552
    If you have a card on file, it may have an expired date.   You must remove it by selecting None, then add a card with a valid date.

  • How can i login to client

    Hi friends,
    iam very new to sap,i installed sap recently,i created a client how can i login to that client(i given user id:sap*,pwd:pass)
    any parameter changes required

    You need to change the parameter on RZ10 select the Default profile add the parameter and change the value and save & activate the profile. Restart the SAP Server and you would be able to login.
    This process is widely available if you will search on google you will find out.
    Regards,
    Subhash

  • How can I import my iWeb sites??????

    I had a crash trying to install Leopard.
    I have reinstalled the original OS with my new Intel iMac. BUT - how can I get my web sites back into iWeb? I REALLY do not want to have to recreate all these pages! It's insane! Is it just ME, or is there absolutely NO WAY to import my stuff in the folder (which I backed up, luckily)? Or do I have to recreate the sites YET AGAIN? Is there no way to make separate web sites so that they don't have to ALL be published in the same folder and have to save and resave and resave EVERYTHING over and over every time I do a new page, or update or whatever. It's maddening.
    Judie

    THANK YOU!
    I just checked it out and it sounds too good to be true.
    I won't do anything with it until I have Leopard installed, but it's great to know it's there and the PRICE IS RIGHT!
    Also, about my install: We bought a 5 pack license and made a copy for me. SOMEONE didn't verify the disk and it obviously had a glitch. When it was checked it got to about 30% and I got a message that the disk wouldn't work. So I clicked whatever buttons I was told to and then got the blue/grey screen. It sat there so long I had to turn it off with the button. Perhaps it was trying to reset everything to before I tried the install, I don't know. So, the problem wasn't necessarily Leopard and my computer, but the disk to start with and perhaps I compounded it by not waiting for 28 hours for it to fix itself <G>. Anyway, I have to kick myself for not doing a back up of EVERYTHING, and my famous last words were "Nothing ever screws up with a mac."
    Lesson learned. I will have a 500G hard drive next week and this will never happen again.
    I will also disconnect all peripherals as I saw some people suggested that was causing problems. But, what is MOST annoying after the data loss is all the TIME that it takes to do this. I have work to do on this darned machine!
    Thanks again for the RapidWeaver tip, tboelsklfte.
    Judie

Maybe you are looking for

  • New iphone 5 will not connect to cellular network

    got new iphone 5 and can't get it connected to at&t cellular network. help.

  • Adding music to my iPhone from a new computer? Is it possible to do so without erasing music already copied?

    I have an iPhone 5c. I originally set it up on my computer at home and copied my music over using iTunes. I am now away on a trip for a few weeks with work and have a work laptop. I have downloaded iTunes and authorized the laptop. I have some music

  • PO Approval Workflow

    hi, We have a requirement like " Need To Send a Notification to the requestor , If the PO sent to the supplier through E-mail was not reached to supplier " Can anyone please help me how to find the status of the mail sent to the supplier (Whether it

  • IPod not showing up in iTunes source list

    Hi, My fifth gen iPod is not showing up in the iTunes source list. I've tried the troubleshooting recommendations (unistall and then reinstall iTunes, delete the iPod/bin file and then update iPod software, etc.) The only one I have not tried is rest

  • Computer quits after CC 2014 updates

    My Mac quits while working in CC 2014 apps. Not just the programs, but the whole machine freezes and has to be manually restarted. It's happened in InDesign, Photoshop, and maybe Illustrator. Is anyone else having this issue?