I'm converting my Play 2 application to a SPA and I'm trying to figure out how to still use SecureSocial for authentication.
I'm removing all the HTML templates (except the ones used by SecureSocial to send emails) and modifying my controllers to only provide JSON responses.
Is it possible to prevent SecureSocial from rendering HTML and let my application exchange authentication data in JSON format? Is there any example or tutorial that explains this topic? I've been googling for a few days now and unable to find any useful or at least understandable information for a newbie like me.
Latest changes in master made SecureSocial more friendly with mobile and SPA apps. You can now use the LoginApi controller to authenticate a user using the UsernamePasswordProvider or any of the OAuth2 based providers.
Related
I am communicating with the guys over at google and they are helping us with our site 'central.bet.co.za'.
The guys over at google are saying that they need me to supply them with "CORS Compliant Predictive JSON Endpoint for the same."
I really dont know where to find this information as I have never used json before or wordpress for that matter
I have tried installing the json.api.user plugin but that doesnt seem to be solving any problems either
Do you mean the Wordpress core Rest API?
http://central.bet.co.za/wp-json/wp/v2/pages
I want to link my website's Wordpress database to mobile application; and I am able to generate the APIs using wp-json plugin in Wordpress.
However, there is a lot of unwanted data which I do not want for the app. What are the custom parameters in the API url which will help me get only the information I am looking for?
http://www.indiafastener.com/wp-json/wp/v2/posts/2031
PS: I know I can manage & eliminate the unwanted information through the app as well however I do not want to unnecessarily pile up lot of data & do filters in the App.
Thanks for your time.
Utpal
Modern versions of WordPress have the REST API built into core therefore a plugin isn't required.
To check the arguments for an API call, take a look at the documentation. For retrieving a post, see: https://developer.wordpress.org/rest-api/reference/posts/#retrieve-a-post. There are no arguments for limiting the data provided by the response.
While it is possible to modify the response (https://developer.wordpress.org/rest-api/extending-the-rest-api/modifying-responses/), I'd advise against it.
As you pointed out in your question, this data can be managed on the app side. I'd argue that is where you should be dealing with it. It's not about eliminating 'unwanted information' but rather recognising the information you do want.
With the somewhat recent update to the Twitter API, links for JSON pages don't seem to work anymore. I'm wondering how I can get a link similar to this one: http://search.twitter.com/search.json?q=apple (which would find tweets about apple). This link is broken (as you'll see if you click on it).
Yes your link is deprecated now, the link would be like this for api v1.1:
https://api.twitter.com/1.1/search/tweets.json?q=apple
PS: You will need to create an account then authorize your application.
The Twitter oauth API V1 is deprecated completely as of late June. You need to change your code API V1.1 which allows you to view the content in the json file via authentication only.
Like #meda said, you need to have an application to run it with.
Once creating an application at twitter, you can use any twitter oauth library to collect the data from the json files.
ASFIK,https://github.com/abraham/twitteroauth [Abraham's twitter oauth] is the best for starters to learn the flow of authentication and easy access of twitter informations.
I am trying to develop an application using node.js.
Since the same application can be accessed from a mobile device sometime later, it is expected that the APIs will return the json data, and not forward the request to a page after setting the appropriate request parameters.
I am mostly a Java backend guy and a newbie in the UI frameworks(including javascript with just basic knowledge).
I was wondering which UI technologies should i use for the UI? Should i go for plain HTML or php or anything else? Also, will the other UI Application be a webapp and deployed probably in a web server?
Started to use the express module for node.js, and it is awesome. It provides jade(and from which the basic UI can be created very easily) but i have not had the chance to see much into it. Also if i start to use jade, i guess in my app.js file, i will need to forward the request to a page, and not return json data, which i want to avoid.
Can someone suggest me which UI technologies should be the way to go?
The UI is supposed to be quite rich, and with lots of functionalities.
Thanks
Tuco
I would definitely recommend using express.js. As you mentioned you can render jade templates and this will display to the user as html.
You can also send plane old JSON data to the client by using the res.json() method made available with express.
Backbone is a client side framework where you can make single page web applications, and all the html templates are rendered on the clients machine rather than on the web server. Data is persisted to a backend database by using a RESTful API and the following ajax requests. GET, POST, PUT and DELETE.
Later down the line you can use this RESTful API for your mobile app.
i'm trying to make a chrome extension and I need the have an options page where the user is able to login. this way the extension knows who he is and can retrieve specific data from a server.
I'm not sure how to do this. Any one has a tutorial page or, better yet, a sample code?
thank you all!
A number of extensions use OAuth or OpenID for authentication. There is a tutorial for OAuth on code.google.com. You could also just use a username/password and make a XHR request to validate them. It really depends on the site and what authentication methods it offers.
You need an authentication engine... In other words you need to have a backend for your chrome extension which handles logging in and logging out. This is extremely easy to do. You can use a backend as a service if it's a small project (look at Parse or Firebase) or write your own backend using a framework like Ruby on Rails.
http://rubyonrails.org/; https://www.parse.com/; https://www.firebase.com/
Options pages are well documented on the official docs, including sample code.