-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Login with Session Cookie #207
Conversation
11cff31
to
b45da1f
Compare
@DumbergerL any chance this can get merged? |
153565e
to
9632fd0
Compare
@devdot I'm sorry that I've kept you waiting so long for an answer. The code looks very good so far, but I can't get the integration test “testAuthWithSessionCookie” to work. Does the test run with your ChurchTools instance? To test this you have to rename the file “integration.example.ini” to “integration.ini” and enter your credentials and adjust the api_url in the “integration-test-data.json”. |
@DumbergerL thank you! There was an error in the integration test that is now fixed (at least it is now running successfully on my end - thanks for the hints). I've added a few more details to the implementation and fixed some issues that I came across while testing this new feature in another project. Let me know if anything is unclear to you! |
26119cc
to
e3642b1
Compare
Nice one @devdot! Thank you very much! |
This package already handles session cookies for authentication between requests. With these few changes, the session cookie string can be extracted (to be stored elsewhere) and re-used at a later time. The suggested login flow follows that of authentication by login token, verifying the session cookie through an attempted call to
whoami
.I've tested this against my own CT instance, I'm not sure about the official integration tests of this package though (I'll try to provide tests).