phonegap authenticate on remote website and access its content - authentication

How can I access content of a website within the PhoneGap WebView?
My application accesses a website with a login form. I want to grab & parse the resulting credentials/content displayed in the website.
Using the ChildBrowser Plugin, it seems that I don't have any access to the child browsers content?
Thanks in advance
Max

Have you looked at XMLHttpRequest? You should be able to use that in your JavaScript to request the page.

I'd use jQuery's .ajax() function for that!

Related

Adding another Website URL to Facebook Login App

I am trying to add another website url to my facebook app in order to use the login functionality not only on one page but on both. Is it possible to do so, since I don't see the option to add a second website url.
Thanks in advance!
You need to add all the website url's you are using to the "Valid OAuth redirect URIs" you can find that under settings! or do you mean that you wanna use the same login for a different website because then the only way to do it is making another login functionality.

Disable Twitter Universal Deep Links

Update: It appears Twitter has fixed this issue. Clicking the authorize button now works! Thank you all for the responses.
I have a UIWebView that opens and directs to Twitters Oauth/Authorize webpage. The user signs in with there Twitter details and authenticates the use of our application with there Twitter account. This process worked perfect before the release of Twitter 6.37 iOS application. What happens now is when the WebView detects https://twitter.com/oauth/authorize?oauth_token instead of staying in the WebView it opens the native Twitter application and dies. If you uninstall the Twitter application everything works as usually it staying within the WebView. How can I prevent this from happening? I want to stay within my UIWebView and not automatically open deep links. I have been reading about the new URL deep link changes in iOS 9, but not sure of how to stop them from my application to other native applications. Thanks for any help!
As a workaround, in twitter authentication screen we can use the Go button on iOS typing keypad instead of using the sign in button on web view until twitter fixes.
Please refer the attached screenshot link for clarity.
Screenshot for the workaround
I ran into this issue as well and figured out it was because my authorize endpoint was set to https://twitter.com/oauth/authorize?oauth_token="+oauthToken (I believe this was in the original documentation). If you add api as the subdomain: https://api.twitter.com/oauth/authorize?oauth_token="+oauthToken, it will no longer trigger the deep linking and load the twitter app.
My answer to this via a Xamarin question:
Unless Twitter removes/updates the apps section of "https://www.twitter.com/apple-app-site-association" to allow a bypass or a secondary oauth that is not in the apple-app-site-association file I do not see how you would do it. These files are signed and iOS handles them at an OS level.
I have not played around very much with the continueUserActivity delegate and the NSUserActivity object that is passed to apps launched from UNI links, but I do not see a way for the launched app (i.e. Twitter) to return control to the original app, and at that point the oauth call-chain would be broken anyway....
Unique. Unlike custom URL schemes, universal links can’t be claimed by other apps, because they use standard HTTP or HTTPS links to your website.
Secure. When users install your app, iOS checks a file that you’ve uploaded to your web server to make sure that your website allows your app to open URLs on its behalf. Only you can create and upload this file, so the association of your website with your app is secure.
Via: https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html
I would report as an issue (bug?) to Twitter's Dev forum: https://twittercommunity.com

Using import.io on a php page

HI trying to run an import io api on a php page and no data is detected.
Is it possible to obtain data from here
or similar web pages?
Thanks
Yes, you can create an API to a PHP page. I have created an API for this website, without any issue.
https://import.io/data/mine/?id=628e1406-9674-4196-b2e2-43a5f49262f4
You can also paginate nicely with this website, as the URL pattern is consistent and you do not need cookies.
http://www.charityperformance.com/charity-search.php?start=20&cat=&search=
http://www.charityperformance.com/charity-search.php?start=40&cat=&search=
If you would like to chat about a specific issue or website, I would suggest contacting support#import.io for further help.
Thanks,
Meg

Facebook: webpage working as an app and a page

I want to make a webpage, that works as an APP (in facebook, iframe) and as a usual webpage too.
How can I accomplish this in a proper way?
Right now, I'm connecting to facebook as an APP with the PHP SDK: getLoginUrl(), then redirect the user to this url, blabla. Works fine if I'm in facebook, and using it as an app.
Problem is if the session is outdated, and I'm not looking this on facebook, this redirecting gets annoying, also: very unprofessional in my opinion...
Thanks in advance!
SOLVED: here's the solution for my specific problem:
It took me 1 change of line in the code, which is the following:
$canvaseurl = ($_SERVER['HTTP_REFERER'] == "https://apps.facebook.com/APPNAME/") ? "https://apps.facebook.com/APPNAME/": "https://MYWEBPAGE.hu/app/";
So I simply redirect to the url, where the user came from.
Pretty simple. :)
Once the person authorizes the application, you will be able to use either the iframe or the website, just so long as you don't force it to go back to the application page. I have used the Facebook PHP SDK and noticed that if you enter the actual location that is loading into the iframe it will stay on that page outside of the apps.facebook.com. However this is dependant on the settings you use. Try experimenting with it and see if that helps you.

How to achieve nice litle USER page url like facebook or twitter?

I have a .NET app and I let users to create their account.
Right now the user page looks like http:///user/?user=guru
I have a user subfolder at the app root and that is where the aspx pages for user page are
How can I let my users access their pages like twitter, facebook or youtube?
Their user profile\channel\account has this format: http://www.facebook.com/guru
This way the URL is short and easy to remember and share
Thanks
This is called "url rewriting". You have some code that takes the original “facebook.com/guru” URL and coverts it into the “facebook.com/?user=guru” URL before the hosting application tries to process it.
Depending on your web server, there is probably a module already built that lets you do this. In IIS, you can either use a custom HttpModule or the URL rewriting module.