Authentication example.

pull/7/head
Ferry Boender 9 years ago
parent 1aaacf8ef9
commit 1351816935
  1. 5
      examples/auth/README.md
  2. 26
      examples/auth/auth.json
  3. 3
      examples/auth/job_do_nothing.sh

@ -0,0 +1,5 @@
ScriptForm auth example
=======================
This example shows how to authenticate users. Everyone must authenticate. Only
user 'test2' is allowed to see and execute the 'only_some_users' form.

@ -0,0 +1,26 @@
{
"title": "Authorization protected",
"users": {
"test": "secret",
"test2": "password"
},
"forms": {
"do_nothing": {
"title": "Test form",
"description": "You should only see this if you've entered the correct password",
"submit_title": "Do nothing",
"script": "job_do_nothing.sh",
"fields": [
]
},
"only_some_users": {
"title": "Only some users",
"description": "You should only see this if you're user 'test2'",
"submit_title": "Do nothing",
"script": "job_do_nothing.sh",
"allowed_users": ["test2"],
"fields": [
]
}
}
}

@ -0,0 +1,3 @@
#!/bin/sh
echo "I did nothing very successfully"
Loading…
Cancel
Save