连接Android/iPhone应用程序和web之间的登录流

时间:2022-03-22 02:35:58

When the person opens my app, I want to display a button. The user clicks this button, and it opens a browser (embedded, of course) inside the app, allowing the user to LOGIN through that web page.

当这个人打开我的应用程序时,我想要显示一个按钮。用户单击这个按钮,它就会在应用程序中打开一个浏览器(当然是嵌入的),允许用户通过该web页面登录。

Of course, when the person logs in, it only logs in to that web server. The web service now knows that the user is logged in.

当然,当用户登录时,它只登录到该web服务器。web服务现在知道用户已登录。

As the user uses my mobile app, I need to know if he's logged in or not. How can I know? There's no way for my app to determine if the user is logged into my web service.

当用户使用我的移动应用时,我需要知道他是否登录了。我怎么能知道?我的应用程序无法确定用户是否登录了我的web服务。

By the way, I am using Django framework for my web service.

顺便说一下,我正在为我的web服务使用Django框架。

1 个解决方案

#1


0  

Well, presumably when your user logs in the server is telling their browser to set a cookie. Why not just capture this cookie and use it to determine if they successfully logged in?

嗯,大概是当用户登录服务器时告诉浏览器设置一个cookie。为什么不捕获这个cookie并使用它来确定它们是否成功登录呢?

#1


0  

Well, presumably when your user logs in the server is telling their browser to set a cookie. Why not just capture this cookie and use it to determine if they successfully logged in?

嗯,大概是当用户登录服务器时告诉浏览器设置一个cookie。为什么不捕获这个cookie并使用它来确定它们是否成功登录呢?