Google Apps customized google login page in appspo

2019-04-11 23:57发布

I have an appspot application in python.

Requirement:

Custom login screen in application where Google users can Signin. Setting up appropriate sessions so that even if user tries to open Google Mail or any authenticated Google site it should open directly without asking username and password. I dont want to redirect them to Google login page.

Things that I've tried so far :

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]

Is there anything that I am missing ? or Is there any other approach for doing this ?

1条回答
放我归山
2楼-- · 2019-04-12 00:44

For hosted google applications, you could use SAML (Google is the SP, and your service can act as the IDP) https://developers.google.com/google-apps/sso/saml_reference_implementation

查看更多
登录 后发表回答