我在 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/