kimai / kimai

Kimai is a web-based multi-user time-tracking application. Works great for everyone: freelancers, companies, organizations - everyone can track their times, generate reports, create invoices and do so much more. SaaS version available at https://www.kimai.cloud
https://www.kimai.org
GNU Affero General Public License v3.0
3.15k stars 550 forks source link

Is there a way to authenticate trough the api interface? #1293

Closed oemilsson closed 4 years ago

oemilsson commented 4 years ago

Tried to figure out if there's a way to authenticate trough the REST interface but this seems not to be possible? If not the case what would be need to be done in order to do so?

kevinpapst commented 4 years ago

What?

oemilsson commented 4 years ago

For example i would like to login not using the website form but instead trough maybe CURL, for example it could look something like the following:

curl --header "Content-Type: application/json" \ --request POST \ --data '{"username":"admin","password":"password"}' \ http://localhost:3000/api/login which then returns me a token of some kind that i can use for the other api endpoints.

Went trough the swagger documentation and couldn't find such endpoint so my questions is: does such endpoint exist or you can only login as a user via web form/ldap?

kevinpapst commented 4 years ago

You use username + api token to authenticate against the API, if you are outside a web context. https://www.kimai.org/documentation/rest-api.html

kevinpapst commented 4 years ago

LOL ... you are welcome