1

我正在尝试为我的 Android 应用程序创建一个 openid 登录活动。

为此,我使用JOpenID ..

我可以获得“端点”和“关联”。

但是..我很困惑中止 setReturnTo() 和 setRealm() 方法

我尝试使用“http://locahost”和“myip”(硬代码)

manager.setReturnTo("http://locahost");
manager.setRealm("http://*.locahost");

代码如下所示。

public void ib_signon(View v)
{
         OpenIdManager manager = new OpenIdManager();

         manager.setReturnTo("http://locahost");
         manager.setRealm("http://*.locahost");

         //gets endpoint
         Endpoint endpoint = manager.lookupEndpoint("Google");
         System.out.println("endpoint=="+endpoint);

         //gets association
         Association association = manager.lookupAssociation(endpoint);
         System.out.println("association=="+association);

         String autUrl = manager.getAuthenticationUrl(endpoint, association);
         System.out.println("Copy the authentication URL in browser:\n" + autUrl);

         //show login-dialog in an webview
         webView = new WebView(this);
         webView.loadUrl(autUrl);
         setContentView(webView);

         /*System.out.println("After successfully sign on in browser, enter the URL of address bar in browser:");
         String ret = readLine();
         HttpServletRequest request = createRequest(ret);
         Authentication authentication = manager.getAuthentication(request, association.getRawMacKey());
         System.out.println(authentication);
         System.out.println("Identity: " + authentication.getIdentity());
         */
         //Intent i = new Intent(this, contactsActivity.class);
         //startActivity(i);
}

在我在 google-login-dialog(webview) 中写入我的帐户数据后,

谷歌回应:

The page you requested is invalid.  
4

0 回答 0