# fpmi.net.openURL with username and password

**URL:** <https://forum.inductiveautomation.com/t/fpmi-net-openurl-with-username-and-password/1335>\
**Category:** Archived Topics\
**Created:** [October 14, 2009, 11:35pm UTC](https://forum.inductiveautomation.com/t/fpmi-net-openurl-with-username-and-password/1335 "2009-10-14T23:35:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![famador](https://avatars.discourse-cdn.com/v4/letter/f/ecccb3/32.png) [@famador](https://forum.inductiveautomation.com/u/famador)\
**Post date:** [October 14, 2009, 11:35pm UTC](https://forum.inductiveautomation.com/t/fpmi-net-openurl-with-username-and-password/1335/1 "2009-10-14T23:35:59Z")

</div>

Hi, I have a link to a website that needs credentials. I want to incorportate that in to my url as fpmi.net.openURL(“[http://username:password@host](http://username:password@host):port/”). However, I can see Internet Explorer 7 or 8 might not support this feature anymore.

Is there another workaround using Jython to pass credentials with the openURL feature?

For instance fpmi.net.openURL(“websiteurl”, username, password)

Please review the attached Jython sample code…it’s possible we just might be able to do this fairly easy, but I don’t know what limitations urllib2 and/or [fpmi.net](http://fpmi.net) might have running on FPMI project.

Does [fpmi.net](http://fpmi.net) have the following Jython class associations?

fpmi.net.HTTPPasswordMgrWithDefaultRealm()  
passman.add\_password(None, theurl, username, password)  
fpmi.net.HTTPBasicAuthHandler(passman)  
fpmi.net.build\_opener(authhandler)  
fpni.net.install\_opener(opener)

Thanks! - F  
[Jython urlOpen with Credentials.txt](https://us1.discourse-cdn.com/inductiveautomation/original/1X/fe06413ee52202f5ae59b94c18e3eebed6d531f8.txt) (2.89 KB)

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [October 15, 2009, 4:51pm UTC](https://forum.inductiveautomation.com/t/fpmi-net-openurl-with-username-and-password/1335/2 "2009-10-15T16:51:58Z")

</div>

Let me try to clear things up a bit.

First of all, fpmi.net.HTTPPasswordMgrWithDefaultRealm() is nonsensical. [fpmi.net](http://fpmi.net) is not urllib2, and urllib2 is not [fpmi.net](http://fpmi.net). They aren’t aware of each other.

Second, urllib2 isn’t included in the Python implementation in FactoryPMI. The [user manual](http://www.inductiveautomation.com/products/factorypmi/usermanual/source/technical/jython/pythonmodules.htm) defines what python libraries are available.

Third, urllib2 doesn’t do what you think it does. It does not open up a web browser at a given location so that the user can interact with the webapge. It opens up the URL for programmatic manipulation, so that you can programatically read the contents at that URL. Not what you wanted.

So, given all that, other than the old “username:password@” prefix, I don’t think there is much you can do. My only other thought would be to specifically invoke iexplore.exe with flags that give it the url, username and password (if such flags exist, I’m not sure).

Good luck.
