Basic HTTP Authentication with the InAppBrowser plugin

1,982 views
Skip to first unread message

Warren Wright

unread,
Oct 17, 2013, 9:48:55 AM10/17/13
to phon...@googlegroups.com
Hi All,

I am putting together a quick prototype at work to demonstrate howe we might wrap an existing web app in a phonegap application using the InAppBrowser plugin.

My first challenge is how one might get past authentication challenges if the URL referenced in window.open requires authentication - for this example simple basic http authentication.

Thank you so much for any suggestions or examples.

Warren

p.s. if anyone has a suggestion for another approach than InAppBrowser, I'm all ears.  The trick is we have a fairly complex web application (order entry system) that has been developed in angular.js with a great deal of work on responsive design, so we'd like to take a look at how this app operates if slotted into a phonegap app as a distribution mechanism (it looks great from what I saw when just displaying it in the InAppBrowser with no authentication the other day).

Warren Wright
/// @wrightling

Warren Wright

unread,
Oct 18, 2013, 3:38:08 PM10/18/13
to phon...@googlegroups.com
Or is it the case that we would need to customize the iOS plugin for InAppBrowser to specifically account for this, and then do the same for the plugin for each other platform (not ideal)?

Ville Karavirta

unread,
Oct 19, 2013, 6:41:12 AM10/19/13
to phon...@googlegroups.com
You can pass the username and password for HTTP basic authentication as part of the URL for the InAppBrowser. So a URL like https://username:pass...@www.yourdomain.com/ should do what you need for your prototype.

Hope this helps,
 Ville

-- 
Ville Karavirta
@vkaravir


--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Warren Wright

unread,
Oct 19, 2013, 11:44:12 AM10/19/13
to phon...@googlegroups.com
That worked!  Thanks so much.  I didn't know that trick (obviously).

Warren

Warren Wright
//// @wrightling

Kerri Shotts

unread,
Oct 19, 2013, 1:46:00 PM10/19/13
to phon...@googlegroups.com, phon...@googlegroups.com
Not at all sure this is wise. While the request is encrypted, the sever may end up saving this in the access lot and/or passing it as a referrer to other requests and/or passing it to your analytical engine. You can configure all that out, usually, but proceed very cautiously. 


___________________________________
Kerri Shotts
photoKandy Studios, LLC


Social Media:
          Twitter: @photokandy, http://twitter.com/photokandy
          Tumblr: http://photokandy.tumblr.com/
          Github: https://github.com/kerrishotts
                        https://github.com/organizations/photokandyStudios
          CoderWall: https://coderwall.com/kerrishotts

Apps on the Apple Store:

Books:


--
Reply all
Reply to author
Forward
0 new messages