예제 #1
0
from uma.message import PermissionRegistrationResponse
from uma.message import ResourceSetDescription
from uma.message import StatusResponse
from uma.resourcesrv import ResourceServer

import uma_as
from uma.userinfo import UMAUserInfo

__author__ = 'roland'

# AS init
AS_PORT = 8088
AS_BASE = "https://*****:*****@example.org",
    },
    "linda": {
        "displayName": "Linda Lindgren",
        "eduPersonNickname": "Linda",
        "givenName": ["Linda", "Maria"],
예제 #2
0
파일: as.py 프로젝트: dv10den/pyuma
                                _name = item["organization"][
                                    "organization_url"][0]["text"]
                            except KeyError:
                                pass
                sps.append((_name, entid))
    return sps


if __name__ == '__main__':
    SERVER_CERT = "pki/server.crt"
    SERVER_KEY = "pki/server.key"
    CA_BUNDLE = None
    SPS = get_sp("./sp/sp.xml")

    # The UMA AS
    AUTHZSRV = uma_as.main(BASE, CookieHandler)

    SRV = wsgiserver.CherryPyWSGIServer(('0.0.0.0', PORT), application)

    if BASE.startswith("https"):
        from cherrypy.wsgiserver import ssl_pyopenssl

        SRV.ssl_adapter = ssl_pyopenssl.pyOpenSSLAdapter(
            SERVER_CERT, SERVER_KEY, CA_BUNDLE)

    #logger.info("RP server starting listening on port:%s" % rp_conf.PORT)
    print "AS started, listening on port:%s" % PORT
    try:
        SRV.start()
    except KeyboardInterrupt:
        SRV.stop()
예제 #3
0
파일: test_seq_4.py 프로젝트: rohe/pyuma
from uma.message import IntrospectionRequest
from uma.message import RPTResponse
from uma.message import PermissionRegistrationResponse
from uma.message import StatusResponse
from uma.message import PermissionRegistrationRequest
from uma.message import ProviderConfiguration
from uma.userinfo import UMAUserInfo
import uma_rs
import uma_as
from uma.client import Client

AS_PORT = 8088
BASE = "https://localhost:%s" % AS_PORT
AS_CookieHandler = CookieDealer(None)

authzsrv = uma_as.main(BASE, AS_CookieHandler)

RS_PORT = 8089
RS_HOST = "https://localhost:%s" % RS_PORT
RS_CookieHandler = CookieDealer(None)
ressrv = uma_rs.main(RS_HOST, RS_CookieHandler)

print("go!")


def introspect(_client, rsrv, asrv):
    _crpt = _client.token[USER]["RPT"]

    _pat = rsrv.permreg.get(RESOURCE_OWNER, "pat")["access_token"]
    _client_x = rsrv.client[rsrv.permreg.get(RESOURCE_OWNER, "authzsrv")]
    ireq = IntrospectionRequest(token=_crpt)
예제 #4
0
파일: as.py 프로젝트: simudream/pyuma
                                _name = item["organization"][
                                    "organization_url"][0]["text"]
                            except KeyError:
                                pass
                sps.append((_name, entid))
    return sps


if __name__ == '__main__':
    SERVER_CERT = "pki/server.crt"
    SERVER_KEY = "pki/server.key"
    CA_BUNDLE = None
    SPS = get_sp("./sp/sp.xml")

    # The UMA AS
    AUTHZSRV = uma_as.main(BASE, CookieHandler)

    SRV = wsgiserver.CherryPyWSGIServer(('0.0.0.0', PORT), application)

    if BASE.startswith("https"):
        from cherrypy.wsgiserver import ssl_pyopenssl

        SRV.ssl_adapter = ssl_pyopenssl.pyOpenSSLAdapter(
            SERVER_CERT, SERVER_KEY, CA_BUNDLE)

    #logger.info("RP server starting listening on port:%s" % rp_conf.PORT)
    print("AS started, listening on port:%s" % PORT)
    try:
        SRV.start()
    except KeyboardInterrupt:
        SRV.stop()