open-ils.auth.login API user/berick/open-auth-login
authorBill Erickson <berickxx@gmail.com>
Tue, 15 Aug 2017 17:13:03 +0000 (13:13 -0400)
committerBill Erickson <berickxx@gmail.com>
Tue, 15 Aug 2017 17:15:18 +0000 (13:15 -0400)
commit4799dec90e2347da27f69f1cb73bac2263070ad0
tree2ce6d06fbe9bd0fba94827d0b522972b03701ac8
parentc5838c87c0f20f1ba01ce525d30c1637751d85e2
open-ils.auth.login API

Adds a new open-ils.auth API call 'open-ils.auth.login' which performs
the combined steps of open-ils.auth.authenticate.init and
open-ils.auth.authenticate.complete so the caller only need call one API
to login.

API params are consistent with open-ils.auth.authenticate.complete with
2 notable excpetions.  The API uses the bare password instead of the
hashed password, so the caller also need not perform the extra hashing
steps.  Also, no 'nonce' parameter is used as it's no longer needed,
because there is no intermediate authentication cache object as with
.init.

Response data is consistent with open-ils.auth.authenticate.complete.

Example:

srfsh# request open-ils.auth open-ils.auth.login {"username":"admin","password":"fakepassword"}

Other changes in the new code:

1. Once a caller has reached the configured maximum number of login
   failures, no further attempts to track failures occurs, based on the
   idea that no additional cpu/network cycles should be used on a lost
   cause.

2. A failure count object is only added to memcache when failures
   occur, unlike open-ils.auth.authenticate.init which creates a
   failure tracking object for every login.

3. The code avoids use of the jsonParseFmt() and va_list_to_string()
   functions as these functions require extra data cleansing.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/c-apps/oils_auth.c