This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| web:agtek_web_site [2018/04/23 23:04] mikeclapp [SQL Driven Pages] | web:agtek_web_site [2018/04/24 22:34] (current) mikeclapp [Protected Pages] | ||
|---|---|---|---|
| Line 49: | Line 49: | ||
| ?> | ?> | ||
| </code> | </code> | ||
| + | |||
| + | **Authentication server code methods (from Mike A Email)** | ||
| + | |||
| + | <code> | ||
| + | |||
| + | Here is theAPI methods you can use to try to log in. | ||
| + | |||
| + | Login: | ||
| + | |||
| + | https://beta.agtek.com/AccessWeb/wa2/api/connection/open?userid=mjallison@agtek.com&password=foo | ||
| + | |||
| + | The response is a JSON object that looks like this: | ||
| + | |||
| + | {"userid":"mjallison@agtek.com", | ||
| + | "firstname":"Michael", | ||
| + | "lastname":"Allison", | ||
| + | "phone":"925-216-7016", | ||
| + | "email":"name@example.com", | ||
| + | "customer":"Agtek", /* this is the customer ID */ | ||
| + | "isadmin":true," | ||
| + | isenterprise":true, | ||
| + | "err":"", | ||
| + | "operations":null, | ||
| + | "code":0, | ||
| + | "events":null} | ||
| + | |||
| + | If code is zero (0), it's good. Non zero will mean some sort of error occurred.  The value | ||
| + | |||
| + | of "err" is a string version of the error code. It's more human readable. It has not been | ||
| + | |||
| + | localized and is server speak. This is what a failure looks like: | ||
| + | |||
| + | {"err":"Password authentication failed for mjallison@agtek.com", | ||
| + | "operations":null, | ||
| + | "code":100, | ||
| + | "events":null} | ||
| + | |||
| + | It's most likely you will receive this because of bad user id or password. | ||
| + | Other errors I can imagine you getting would be for network conditions or | ||
| + | if a corporate firewall/proxy server gets in the way. I don't know what those | ||
| + | error values would be. That's what testing is for. | ||
| + | |||
| + | |||
| + | |||
| + | You can ignore "operations" and "events", it's even possible I will make them go away. | ||
| + | |||
| + | They are there because of the application machinery getting involved at a very low level.  | ||
| + | |||
| + | Likely these values will always be "null" when you make this call. | ||
| + | |||
| + | |||
| + | |||
| + | Token login is available via /validate, but since you are not saving tokens, I won't detail it here. | ||
| + | |||
| + | |||
| + | |||
| + | This code is not yet deployed on Beta, I will do so later today. | ||
| + | |||
| + | </code> | ||
| + | |||
| === Authentication === | === Authentication === | ||