Syncing a Python-App with Z-Push
-
Hello Forum,
i wonder, if there already exits a Python-Package for syncing a Python-App with Kopano via Z-Push.
If there isn’t, can someone eventually provide me with some basic information (or code) about best way to start implementing such a Package in Python?
Many thanks in advance!
-
Hi @dait,
I am not aware of any python libraries implementing the ActiveSync protocol (this is what Z-Push is offering). Depending on your actual use case the newly introduced rest api probably offers a better/easier option for integrating with your application.
(the “probably” is since it is newly introduced in 8.7 and therefore not yet as complete and mature as a z-push)
-
Hi @fbartels ,
sounds very interesting. Do you know approximatly when repositories for supported Kopano versions will be available for Kopano Konnect and KAPI?
Is KAPI also usable with a differnet authentification (e.g Azure)?
Thanks!
-
@dait it was released with Kopano 8.7.0 and therefore (supported) repositories are already available.
Authentication of the rest api always needs to be handled by our openid provider (which in turn verifies the user against whatever kopano-server uses to manage users).
-
@fbartels So is KAPI part of the Kopano 8.7.0 core? If so could you please give me a hint how to install it?! I can’t find KAPI in a fresh installation of 8.7.0. Sorry if i get it wrong!
Or could this even be a license problem? If i log into the kopano portal, i neither can find KAPI in the download section nor can generate a repository file with KAPI in it.
If the second is true, could you evtl. provide me with an address like:
deb https://serial:XXXXX@download.kopano.io/supported/KAPI???:/final/Ubuntu_18.04/ /Thank you!
-
@dait the package for it is actually called
kopano-kapid
and is part of https://download.kopano.io/supported/core:/final/Ubuntu_18.04/.There is a high level explanation of the required configuration in https://documentation.kopano.io/kopanocore_administrator_manual/configure_kc_components.html#configure-kopano-api and some more in depth its also explained in https://documentation.kopano.io/kopano_meet_manual/installation.html#installing-meet-and-its-dependencies
-
@fbartels thanks! I’ve been able to get kopano-konnectd, kopano-kapid and kopani-grapi installed and running.
The next question is how i can register my Python App to get connected. Do i get it right, that there has to be an entry in a file called indentifier-registration.yaml like described in the short introduction: https://kopano.com/blog-de/short-introduction-kopano-konnect/?lang=de
If so, do i need to create the file in /etc/kopano/ and name it identifier-registration.yaml ?
What kind of scopes do i need to apply? (openid profile email konnect/id? konnect/hashed_sub? kopano/gc?) Do i need to enter these scopes in the ‘trusted_scopes’-section in the identifier-registration.yaml?
Sorry for so many questions and thanks for your help!
-
Hi @dait,
that blog post is from the time before konnect was packaged, the default filename in the packaging is now called
/etc/kopano/konnectd-identifier-registration.yaml
. But you will only need it if your application is served on a different domain as konnect and therefore are seen as “untrusted”.To get these applications to a trusted level you would indeed need to register them in said file. I have not revisited the blog, but I think it already makes reference towards https://stash.kopano.io/projects/KC/repos/konnect/browse/identifier-registration.yaml.in for some example values.
btw. in the kapi source code you will find a simple api playground as an example client: https://stash.kopano.io/projects/KC/repos/kapi/browse/examples
Once you have copied this to your webserver (for example into the subfolder
/kapi-playground
you can just visit it with a browser, for example like this:https://your.server.com/kapi-playground/?discovery_uri=https://your.server.com/.well-known/openid-configuration&discovery=auto#
-
Hi @fbartels,
thanks for the information. I have adopted the configuration file accordingly.
Unfortunatelly there seems to be a problem with the configuration of the apache web server. When i try to connect https://your-domain/signin/v1/welcome, i see the background image of the login page, but get an error message “Failed to connect to server” with a http 400 response.
I have added the apache proxy snippet as described in the doc: https://documentation.kopano.io/kopanocore_administrator_manual/configure_kc_components.html#configure-kopano-konnect
However in my apache log i find the according 400 response with a POST request:
mail.mykopanoserver.com:443 217.247.102.56 - - [21/Feb/2019:21:49:41 +0100] "GET /signin/v1/identifier HTTP/1.1" 200 4326 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0" mail.mykopanoserver.com:443 217.247.102.56 - - [21/Feb/2019:21:49:41 +0100] "GET /signin/v1/static/css/main.193426ca.css HTTP/1.1" 304 3437 "https://mail.mykopanoserver.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0" mail.mykopanoserver.com:443 217.247.102.56 - - [21/Feb/2019:21:49:41 +0100] "GET /signin/v1/static/js/main.9b0201a7.js HTTP/1.1" 304 198 "https://mail.mykopanoserver.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0" mail.mykopanoserver.com:443 217.247.102.56 - - [21/Feb/2019:21:49:41 +0100] "GET /signin/v1/static/js/identifier-app.3bff122d.chunk.js HTTP/1.1" 304 198 "https://mail.mykopanoserver.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0" mail.mykopanoserver.com:443 217.247.102.56 - - [21/Feb/2019:21:49:43 +0100] "GET /signin/v1/static/js/identifier-container.0f6312ae.chunk.js HTTP/1.1" 304 198 "https://mail.mykopanoserver.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0" mail.mykopanoserver.com:443 217.247.102.56 - - [21/Feb/2019:21:49:43 +0100] "GET /signin/v1/static/media/loginscreen-bg.cc3ef0e4.jpg HTTP/1.1" 304 198 "https://mail.mykopanoserver.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0" mail.mykopanoserver.com:443 217.247.102.56 - - [21/Feb/2019:21:49:43 +0100] "GET /signin/v1/static/media/loginscreen-bg-overlay.b1430cca.svg HTTP/1.1" 304 198 "https://mail.mykopanoserver.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0" mail.mykopanoserver.com:443 217.247.102.56 - - [21/Feb/2019:21:49:43 +0100] "GET /signin/v1/static/media/kopano-logo.10e256c7.svg HTTP/1.1" 304 198 "https://mail.mykopanoserver.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0" -> mail.mykopanoserver.com:443 217.247.102.56 - - [21/Feb/2019:21:49:43 +0100] "POST /signin/v1/identifier/_/hello HTTP/1.1" 400 231 "https://mail.mykopanoserver.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0" <- mail.mykopanoserver.com:443 217.247.102.56 - - [21/Feb/2019:21:49:43 +0100] "GET /signin/v1/static/media/loginscreen-bg.cc3ef0e4.jpg HTTP/1.1" 304 198 "https://mail.mykopanoserver.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0" mail.mykopanoserver.com:443 217.247.102.56 - - [21/Feb/2019:21:49:43 +0100] "GET /signin/v1/static/media/loginscreen-bg-overlay.b1430cca.svg HTTP/1.1" 304 198 "https://mail.mykopanoserver.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
The apache modules mod_proxy and mod_proxy_http are enabled. Do you have a clou, what i have missed?
Thank you!