创建具有AngularJS的认证机制/离子框架 [英] creating an authentication mechanism with AngularJS/Ionic Framework

查看:103
本文介绍了创建具有AngularJS的认证机制/离子框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试用angularjs创建基于离子应用程式的认证机制。该系统是这样的:

I try to create with angularjs based Ionic app an authentication mechanism. The system looks like this:

在这里输入的形象描述

移动用户通过在服务器上管理员创建。这创造了移动用户可以登录到应用程序。

mobile users are created by administrators on the server. This created mobile user can login into the app.

在用户存储在一个JSON对象的服务器上。我想象中的步骤如下?

The users are stored on the server in a JSON object. I had imagined the steps as following?


  1. 要JSON对象的联系应该被解析。

  2. 在服务器上创建的用户和密码都与比较
    本地登录数据

  3. 如果用户成功登录到系统中,用户数据
    应存储在本地。

编辑:

认证的流程来进行,如下所示:

The flow of the authentication will be effected as follows:

在这里输入的形象描述

如何创建一个登录系统,这样的编程方式?

How to create a login system like this programmatically?

推荐答案

的步骤应该是

1)利用发送用户名密码服务器$ http.post();

1) Send username password to server using $http.post();

2)服务器进行身份验证的凭据。并返回回报令牌的凭据是正确的。

2) Server authenticates the credentials. and returns a token in return is credentials are correct.

3)应用程序商店此令牌本地并将其传递给服务器作为以后的登录用户识别平均请求。

3) App stores this token locally and passes it to server for later request as a mean of identification of logged in user.

在理想情况下,你应该实现SOAP或服务器上的基于REST的服务,并在您的应用程序使用这些服务。

Ideally you should implement SOAP or REST based services on your server and consume those services in your app.

这篇关于创建具有AngularJS的认证机制/离子框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆