Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/195.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Google openID登录集成_Android_Android Studio_Google Openid - Fatal编程技术网

Android Google openID登录集成

Android Google openID登录集成,android,android-studio,google-openid,Android,Android Studio,Google Openid,我随后为我的应用程序实现了openId登录 我使用了https://www.google.com/accounts/o8/id,但有些网站如何在emulator中不显示Google登录页面。只显示空白页 下面是我的相关代码片段。有什么意见吗 Intent intent = new Intent(this, WebViewActivity.class); intent.setData(Uri.parse("https://www.google.com/account

我随后为我的应用程序实现了openId登录

我使用了
https://www.google.com/accounts/o8/id
,但有些网站如何在emulator中不显示Google登录页面。只显示空白页

下面是我的相关代码片段。有什么意见吗

Intent intent = new Intent(this, WebViewActivity.class);
                intent.setData(Uri.parse("https://www.google.com/accounts/o8/ud"));
                startActivityForResult(intent, 0);
webview活动
code:

 protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // Allow the title bar to show loading progress.
        requestWindowFeature(Window.FEATURE_PROGRESS);

        WebView webview = new WebView(this);
        setContentView(webview);

        // Load the page
        Intent intent = getIntent();
        if (intent.getData() != null) {
            webview.loadUrl(intent.getDataString());
        }
................
}

我的web应用程序使用的是
OpenId
,因此
OAuth
对我来说不是一个选项。

我做了与示例中提到的相同的事情

当我试图打开你提到的url时
https://www.google.com/accounts/o8/id

我得到下面的屏幕

当我尝试url
https://www.google.com/accounts/o8/ud
它重定向到
https://accounts.google.com/o/openid2/auth

并在我的网络视图中显示以下屏幕

我认为url应该有这些参数

?? client_id=424911365001.apps.googleusercontent.com& 响应类型=代码& 范围=openid%20电子邮件& 重定向\u uri= 状态=安全令牌%3D138r5719ru3e1%26url%3Dhttps://oa2cb.example.com/myHome& 登录提示=jsmith@example.com& openid.realm=example.com& hd=example.com

正如这里提到的
https://developers.google.com/accounts/docs/OAuth2Login#sendauthrequest

屏幕需要一些时间来显示,所以请等待一段时间,以查看我发布的输出。请确保在尝试时未连接到任何受限制的wifi网络。最好尝试任何2g或3g网络

已更新

检查一下这个打开的Id

(检查第三点以获取请求)

关于终点


在您的
Uri.parse
中,您有
ud
而不是
id
。“有问题吗?”豪斯曼:我两个都试过了,两个都没用。我认为在获取端点(服务器url)方面还缺少一个步骤(发现)。但是我找不到任何正在进行探索的例子。记录在案,谷歌。谢谢你的回答!我认为客户端id不是静态的,我们需要发现它。你是怎么得到那个网址的?在发送authrequest之前,我们需要查找(AFAIK),不是吗?您正在谈论哪个URL?一个<代码>https://accounts.google.com/o/openid2/auth尝试加载时自动重定向
https://www.google.com/accounts/o8/ud
在webview中。我想你可以通过注册你的应用程序从谷歌API控制台获得客户端Id。是的,我说的是客户端Id,我们需要注册应用程序吗?今晚让我查一下。谢谢是的,如果要在谷歌API控制台中使用你的应用程序PackageName和证书SHA1签名使用谷歌OpenId,你必须注册你的应用程序。目前为止没有成功。您建议的方法(注册应用程序)似乎是oAuth。我还在挣扎。