Android应用程序登录MS SQL [英] Android App Login MS SQL

查看:119
本文介绍了Android应用程序登录MS SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作一个需要用户登录MS SQL数据库的android应用.

I am trying to make an android app that requires a user to login against a MS SQL Database.

读过最流行的方法似乎是使用JSON来做到这一点,但是我不确定这样做的安全性(特别是如果没有使用SSL的话).

Having read around the most popular way seems to be to use JSON to do this however I'm not sure how secure this would be (especially if there is no SSL being used).

我的问题是,有哪些可用的替代方法?如果JSON是实现这一目标的最佳/最简便方法,我如何使其更安全?这也是大公司(例如保管箱等)这样做吗?

My question is what are the alternatives available and if JSON is the best/easiest way to achieve this how can I make it more secure? Is this also how big companies (such as dropbox etc) do this?

推荐答案

当我第一次开始Android编程时,我被告知直接连接到数据库被认为是一种不好的做法,并且使用了一个接口(JSP,PHP,.NET) )应始终使用.我不知道这是否安全,但这可能是最适合您的.

When I first started Android programming I was told that making a direct connection to the database is considered bad practice, and that an interface (JSP, PHP, .NET) should always be used. I don't know if this is a security thing or not but it would probably be the best for you.

如果可能,创建一个.NET(或您喜欢的任何服务器端语言;如果使用MS SQL服务器,.NET可能是最简单的)页面,然后通过HTTPS与您交谈.安全性),然后使用POST向其传递登录信息.您可以使用JSON,但名称值参数可以完成相同的操作.让您的页面连接到数据库,并对照其中传递的信息测试您传递给它的信息.然后传回一个值,该值表示响应中是否正确.

If possible, create a .NET (or whatever server-side language you are comfortable with; .NET would probably be the easiest if you're working with a MS SQL server) page and talk to it over HTTPS (there's your security) and pass it the login info using POST. You could use JSON but name value parameters would accomplish the same thing. Have your page connect to the DB and test the information you pass it against whatever is in it. Then pass back a value that says whether it is correct or not in the response.

这看起来像不错的在Android上设置HTTPS的指南(只是快速浏览了一下,所以我不能100%保证).

This looks like a decent guide to getting HTTPS set up on Android (just browsed through it quickly so I can't vouch for it 100%).

这篇关于Android应用程序登录MS SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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