获得"错误的用户名或密码"在Android的WebView中的身份验证后重定向 [英] Getting "wrong username or password" after an auth redirect in Android WebView

查看:212
本文介绍了获得"错误的用户名或密码"在Android的WebView中的身份验证后重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Twitter REST API-Android应用程序。
当用户点击登录用Twitter 我运行一个获取授权/认证并重定向用户 https://开头的API。 twitter.com/oauth/authenticate?oauth_token=aaa123

I have a Twitter REST API-Android application. When user clicks Sign in with Twitter I run a GET authorize/authenticate and redirect user to https://api.twitter.com/oauth/authenticate?oauth_token=aaa123


  • 如果用户已登录,微博页面要求用户进行授权。一切都很好。

  • 如果用户没有登录,页面上方出现这样的文字:

  • If user is already logged in, Twitter page asks user for authorization. Everything is fine.
  • If user isn't logged in, on top of the page this text appears:

有些事情是技术上的错误,错误的用户名或密码

"Something is technically wrong" "wrong username or password"

和Twitter页面要求用户填写用户名和密码。我的游客抱怨在上面这个警告。他们说,他们甚至但Twitter页面表示,错误的密码不填写用户名和密码。什么创造了这个警报?我怎样才能prevent呢?我应该授权增加更多的参数/验证?

And Twitter page asks user to fill username and password. My visitors complains about this warning on top. They say that they even didn't fill their username and password but Twitter page says that wrong password. What creates this alert ? How can I prevent it ? Should I add more parameters in authorize/authenticate ?

用户填写用户名和密码后,验证流程成功完成。但我需要禁用虚假的错误。

After user fills username and password, auth flow finishes successfully. But I need to disable false error.

(我不明白在移动浏览器或桌面浏览器的这个错误。只有在移动应用程序)

(I don't get this error on mobile browsers or desktop browsers. Only in mobile app)

推荐答案

我解决我的问题。问题是加载的Twitter页面AUTH

I solved my problem. The problem is loading Twitter auth page.

当我使用这个我得到错误的用户名或密码的错误:

When I use this I get "wrong username or password" error:

webView.postUrl("https://api.twitter.com/oauth/authenticate?oauth_token=aaa123",
        EncodingUtils.getBytes(data, "base64"));

我没有得到这个错误这种类型的呼叫:

I don't get this error for this type of call:

webView.loadUrl("https://api.twitter.com/oauth/authenticate?oauth_token=aaa123");

这篇关于获得"错误的用户名或密码"在Android的WebView中的身份验证后重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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