matrix-org / sydent

Sydent: Reference Matrix Identity Server
http://matrix.org
Apache License 2.0
292 stars 82 forks source link

The project lacks documentation for implementing identity server in real life #29

Closed sander85 closed 5 years ago

sander85 commented 7 years ago

I started the server with python -m sydent.sydent - everything seems to work but there is no info how I should configure web client or Android app to use the identity server.

Currently synapse gives this error:

2016-11-27 16:57:30,814 - synapse.http.server - 139 - ERROR - POST-53- Failed handle request synapse.http.server._async_render on <synapse.rest.ClientRestResource object at 0x7f5694cc1f90>: <SynapseRequest at 0x7f568ddf1518 method=POST uri=/_matrix/client/r0/account/3pid/email/requestToken clientproto=HTTP/1.1 site=8448>
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/synapse/http/server.py", line 116, in wrapped_request_handler
    yield request_handler(self, request, request_metrics)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1126, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/lib/python2.7/dist-packages/synapse/http/server.py", line 255, in _async_render
    callback_return = yield callback(request, **kwargs)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1126, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/lib/python2.7/dist-packages/synapse/rest/client/v2_alpha/account.py", line 195, in on_POST
    ret = yield self.identity_handler.requestEmailToken(**body)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1126, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/lib/python2.7/dist-packages/synapse/handlers/identity.py", line 158, in requestEmailToken
    params
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1128, in _inlineCallbacks
    result = g.send(result)
  File "/usr/lib/python2.7/dist-packages/synapse/http/client.py", line 128, in post_urlencoded_get_json
    defer.returnValue(json.loads(body))
  File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py", line 505, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
JSONDecodeError: Expecting value: line 2 column 1 (char 1)

Should I specify port (8090) too or will the server detect itself? If the port is specified in web client then it starts to spin but there is no response nor anything interesting in the logs. Really no idea what I'm missing here..

ara4n commented 7 years ago

@dbkr enough people are trying to run their own sydents that we should write a basic README sometime soon.

maxidorius commented 7 years ago

@sander85 We have created a read-only identity server backed by a LDAP server (more to come), in case that would fit your use: https://github.com/kamax-io/mxisd

richvdh commented 5 years ago

we have a readme?

menturion commented 5 years ago

I am missing the responses to the listed requests. Could you please add examples to the documentation.

For instance, how does the (JSON) response of the identity server upon a lookup request look like ...

Request: curl 'http://localhost:8090/_matrix/identity/api/v1/lookup?medium=email&address=henry%40matrix.org'

Response: { ??? }

Many thanks in advance.

t3chguy commented 5 years ago

@menturion https://matrix.org/docs/spec/identity_service/r0.1.0.html#get-matrix-identity-api-v1-lookup

menturion commented 5 years ago

@t3chguy Many thanks!