duanqu9279 2016-06-02 08:58
浏览 18
已采纳

too long

Background

So I've been researching quite a bit for the past week about API's and have been reading about concepts and also programming one.

Currently I have a website which is programmed in PHP using a popular framework called Laravel. The website has a user database and users are able to log into the dashboard on my website, everything works as I want it to for my website side.

Now for the next project of my business i'm focusing on creating my mobile applications (IOS & Andriod).What I need for these mobile applications is being able to login through the application UI (not being redirected to my site with a callback URL) so they are able to view and manage the dashboard.

The method of authentication and authorization that i want to use for my application will go something like

  • Client asks user to login through UI
  • User enters credentials
  • Client sends a request to login to the API
  • The API checks if the credentials are correct
  • API creates a token which is stored in token database linked to user ID
  • API returns 200 OK with a json response or something like this

{ "token" : "OLS25usJIay81hdy81", "expiry" : 3/06/2016 14:00}

  • Client remembers token and expiry
  • Whenever a user/client makes a request such as api/v1/mystuff/orders it sends the token with the request(probably through the http headers?)
  • API verifies token, gets user ID and finds users orders

Questions

I know this is one hell a question and i'm not asking you people to program my entire software haha but what I need to know is

  • What should I use to create the API (needs to be PHP, and preferably laravel integrated)
  • What are some good resources to help me program my API
  • Is there any suggestions/changes you'd recommend?

Requirements

  • Username/Password authentication
  • Token Authorization
  • Login through app UI (Not on my website with a callback)

Notes

  • My website has a SSL cert.
  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。