python - Google Apps 在 appspot 中定制了 google 登录页面

标签 python google-app-engine single-sign-on google-apps

我在 python 中有一个 appspot 应用程序。

要求:

Google 用户可以登录的应用程序中的自定义登录屏幕。设置适当的 session ,以便即使用户尝试打开 Google Mail 或任何经过身份验证的 Google 站点,它也应该直接打开而不询问用户名和密码。 我不想将他们重定向到 Google 登录页面。

到目前为止我尝试过的事情:

1st Approach
    1) Using ClientLogin, validate username and password in py
        - Get Auth token
        - Using Auth token retrieve Cookies
        - Redirect to secured appspot url by setting up the Cookies. 

    Now this should ideally take me to the secured url of appspot application. But its showing the Google Login page. 
    Source code : [http://pastebin.com/wfZ8eDGM][1] [http://stackoverflow.com/questions/101742/how-do-you-access-an-authenticated-google-app-engine-service-from-a-non-web-py][2]
2nd Approach
    1) Plainly copied the html source from Google Login page and paste it in login.html as described here http://stackoverflow.com/questions/13815084/custom-google-apps-login-page/13815342#13815342
    2) Upon clicking login button, its showing "Oops! Your browser seems to have cookies disabled. Make sure cookies are enabled or try opening a new browser window. ". But cookies are enabled in broswer.
    Source code: [http://pastebin.com/N7thPc3u][3]

有什么我想念的吗?还是有其他方法可以做到这一点?

最佳答案

对于托管的谷歌应用程序,您可以使用 SAML(谷歌是 SP,您的服务可以充当 IDP) https://developers.google.com/google-apps/sso/saml_reference_implementation

关于python - Google Apps 在 appspot 中定制了 google 登录页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23306993/

相关文章:

python - 使用 Flask 从 Jinja 模板中的 settings.py 文件获取变量

python - 为什么 numpy 整数减法会产生 float64?

python - 强制YouTube API upload_video.py身份验证在外部浏览器中打开?

python - 使用 List Comprehension 和/或 map 避免嵌套 for 循环

Python:写入特定的 CSV 列

python - Google 应用引擎上的 Django : debug queries to datastore

java - 是否可以在 GAE 上使用 2 路电子邮件中继?

使用当前用户的凭据进行 javamail NTLM 身份验证

用于 Air 应用程序和 Web 服务身份验证的 iOS Facebook SSO

java - 在 Azure AD 中生成用于 SSO 的 IDP 证书