How to write API for following web application? [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
My job is to write an API for my web application which is using another website authentication. I know very basic of javascript and PHP and HTML. I need some help to show me the path to write the API for this website.
Here is a link to the documentation of the website:
https://affinitylive.jira.com/wiki/display/APIS/Web+Applications
As it says, I must send this URL to get token->>>
https://hq.local.affinitylive.com/oauth2/v0/authorize?
scope=read(all)&
state=page_two&
redirect_uri=https://app.com/oauth_callback&
response_type=code&
client_id=34ad67fa2f#hq.local.affinitylive.com
and then after I got the token
POST /oauth2/v0/token HTTP/1.1
Host: hq.local.affinitylive.com
Content-Type: application/x-www-form-urlencoded
Authorization: Basic {client_id}:{client_secret}
code=frLA0s1m_D&
redirect_uri=https://app.com/oauth_callback&
grant_type=authorization_code
What I am not really sure and I love to learn is how this communication between my website and their website for authentication will be made. If the answer is wrong I wish to find a way to learn this more. Any guide or suggestion will be appreciated.

There are many methods to do this.
The below url will give you good information about them.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html
And to achieve this, we can use javascript/php (example). In javascript we can make ajax calls to send the request. In php we can use curl to achieve the same.

Related

How to secure MySQL Connection and Informations On Desktop App [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
i'm really new to these things. Normally in making website it's easy to secure it becasue everything is actually local. Just PHP or someting like that process data and shows up in a static page. But when we got desktop app i don't know how to do it. How can i make app <-> server relation? Like Instagram or Facebook or something like that. At the first i think JSON might work for that, but it think it's not secure for all information.I hope i explained good.
Little bit late but if someone comes here, here's the answer you're looking for; HTTP. Yeah It's that simple. Learn how HTTP works. For making security tight, look for cross origin resource sharing (CORS), two-way encryption, server-side validation and so on. Have a good day!

Would you suggest the "mailto" way if there's no knowledge of "PHP coding? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm in hurry to upload the template that I already edited and have no time to learn PHP.
Do you suggest the link below as a "temporary way" of displaying my contact info till the day I learn PHP coding? A code like this link?
Without using a 3rd party mail service (maybe such as an API where you can send requests in order to send mail) or using PHP (or other server side languages) to send mail from the server directly, I don't believe there is any other option.
mailto seems to be your best bet.
You can use http://www.jotform.com/ to create form in order to send e-mail without PHP skill.

Making my own website with server [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am making my own website and I've never really done it before. I am familiar with each of the separate parts, but I've never put them all together before.
I want to have html and javascript on the front end. This would send HTTP requests to my PHP on the backend. The PHP would then have an open socket with my java server that would store data in mysql or mongodb.
javascript client, PHP backend, Java server, mysql/mongo database.
Is this the appropriate way to set up a restful api in a general sense? If not, how should I do it?
You have it right. Javascript on the front end and PHP on the backend is an incredibly popular and powerful combination. The Apache server seems to be more popular among PHP users, but a java server works just fine.

Play Framework JSON and HTTP Request [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am trying to perform a simple method that can handle JSON and HTTP request. Why is this? Because if in some point I decide to create, not only a Webapp also a Mobile APP, I can handle the request with JSON. (I donĀ“t know if this is the best way, if is not please let me know, what would you do?)
My problems is: to handle JSON and HTML in Play, I think that all the request and response need to be intercepted with JavaScript from the HTML side, because need to be parsed as a JSON object. But is there any way to do so , as if it were a simple HTML request?
What is the best way to create a back-end service that will work for a Mobile and WebApp?
Please let me know if you need more info. or something else and your opinion about how I am handling this.
Thanks in advance to all.
The best way is to create REST APIs with the JSON response so that you can integrate it with any UI app or mobile app. Playframework has given support for HTML too, but as per my opinion create a REST API
You can integrate this REST service to any UI app using any javascript framework.

Example Sign-up/Sign in using node.js [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm new on using node.js
Surfing around the web i couldn't find any example of code of a simple sign-up/sign-in that could also show me how to manage database in node.
I mean the app.js page for server and the related client-side html page, and their relation. Can someone help me or give some useful link i couldn't find?
using Cassandra and i.o. socket, it'd be the best help.
You can use Passport library http://passportjs.org/ , there should be an example there. You can also use https://npmjs.org/package/passport.socketio if you want to login by socket.io
I recommend using http://passportjs.org
It has support for simple username/password authentication as well as OAuth etc
http://passportjs.org/guide/username-password/
There's also a good tutorial here:
http://danialk.github.io/blog/2013/02/23/authentication-using-passportjs/

Categories