2012-04-02 65 views
3

我正在嘗試實施單點登錄(GMAIL)。嘗試使用此鏈接https://developers.google.com/accounts/docs/MobileApps示例代碼。我無法獲取YOUR_AUTHENTICATION_ENDPOINT令牌密鑰。請任何人幫我拿出YOUR_AUTHENTICATION_ENDPOINT令牌密鑰。Android:如何獲取YOUR_AUTHENTICATION_ENDPOINT在GMAIL上的SSO?

這裏是我的main.activity這裏我使用YOUR_AUTHENTICATION_ENDPOINT。

@Override 
    public boolean onCreateOptionsMenu(Menu menu) { 
// Inflating the menu resource. 
MenuInflater inflater = getMenuInflater(); 
inflater.inflate(R.menu.my_menu, menu); 
return true; 
    } 

    @Override 
    public boolean onOptionsItemSelected(MenuItem item) { 
    switch (item.getItemId()) { 
    // Start the WebViewActivity to handle the authentication. 
    case R.id.login: 
    Intent intent = new Intent(this, WebViewActivity.class); 
    intent.setData(Uri.parse(YOUR_AUTHENTICATION_ENDPOINT)); 
    startActivityForResult(intent, 0); 
    return true; 
    // Exit. 
    case R.id.exit: 
    finish(); 
    return true; 
} 
return super.onOptionsItemSelected(item); 
} 

應用程序是運行時我得到這個錯誤:

04-02 15:09:12.271: E/Web Console(924): SyntaxError: Parse error at https://mail.google.com/mail/x/cc6i6zigt73b-/?pli=1&f=1&shva=1:1 

我需要一個緊急的幫助..請請請任何人都可以幫助我。

或給我任何其他選項或方法來實現對GMAIL

在此先感謝了單點登錄...

回答

1

對於谷歌應用程序引擎的託管帳戶,登錄URI是:

https://myapp.appspot.com/_ah/login?continue=REDIRECT

其中,myapp是應用程序的名稱和REDIRECT應設置在這裏您將獲取進一步AU域資源來源。 cookie將由認證機制相應設置。 https://myapp.appspot.com是我用作REDIRECT

編輯

我很抱歉,但我誤解你的問題。您希望使用基於Web的身份驗證進行身份驗證。我向您提供了終端用於通過手機上的Google帳戶進行身份驗證。對於基於Web的登錄URL,您可以使用users.create_login_url()users.create_logout_url()。這裏更多的信息:https://developers.google.com/appengine/docs/python/users/loginurls

+0

無法加載您的web瀏覽器鏈接。拋出500服務器錯誤 – 2012-04-02 10:05:20

+0

更新了答案。 – 2012-04-02 10:11:13

+0

謝謝 - 羅漢..但我想用java或android .. plz你能幫我嗎。在此先感謝 – 2012-04-02 10:31:17