HackerspaceBremen / open_space_notifier

This repository holds the source code of the open space notifier, which is a backend for serving the SpaceAPI. The backend is hosted on an Google App Engine instance and written with Java.
3 stars 1 forks source link

Login REST action #60

Closed trailblazr closed 10 years ago

trailblazr commented 10 years ago

Hi Steve,

can we have a simple /v2/cmd/verifylogin action for the REST api documented here: https://code.google.com/p/hackerspace-bremen/wiki/Backend

That one should take just the users name and pass and return an OK or something else. This would be helpful to check credentials without initiating any action on first try.

Helge

steveliedtke commented 10 years ago

Yes this is possible. I will look into it.

steveliedtke commented 10 years ago

Is deployed on the test server. Needs to be tested though

steveliedtke commented 10 years ago

The /v2/cmd/verifyLogin returns the http status 200 if credentials are correct:

curl --data "name=helge&pass=hallo" "https://testhackerspacehb.appspot.com/v2/cmd/verifylogin" -k {"SUCCESS":"Credentials are valid"}

If the credentials are not correct http status code 400 is returned:

curl --data "name=helge2&pass=hallo" "https://testhackerspacehb.appspot.com/v2/cmd/verifylogin" -k {"ERROR":"Either no Keykeeper with the given name exists or the keeper has no authentication to open or close the space","CODE":1}