GAE中的SAML SAML

时间:2015-07-23 22:43:24

标签: python google-app-engine saml

是否有可以使用python在App Engine中进行SAML身份验证的库?

我看过pysaml2确实说它是纯粹的python实现。但是,它使用的是subprocess.Popen,它不能在App Engine中使用,并且会在那时失败。

2 个答案:

答案 0 :(得分:2)

如果将flex环境与standard python27运行时provided by google构建的自定义运行时一起使用,则可以在GAE上使用python-saml。我刚刚使用以下设置成功地使用此方法进行了python-saml flask-demo

Dockerfile:

FROM gcr.io/google_appengine/python
LABEL python_version=python
RUN virtualenv /env -p python

# Install system packages for onelogin dependencies not already included in runtime
RUN apt-get update && apt-get --yes --quiet install python2.7-dev libxmlsec1-dev

# Set virtualenv environment variables. This is equivalent to running
# source /env/bin/activate
ENV VIRTUAL_ENV /env
ENV PATH /env/bin:$PATH
ADD requirements.txt /app/
RUN pip install -r requirements.txt
ADD . /app/
CMD python index.py

的app.yaml

runtime: custom
env: flex
entrypoint: python index.py

api_version: 1
threadsafe: true

requirements.txt

flask==0.10.1
python-saml

然后只需gcloud app deploy app.yaml --version v1

答案 1 :(得分:0)