Activation
Except for the sample project, projects are created with security disabled. So, a typical project creation sequence might be:
-
Create your project without security
- Verify connectivity, API operation, Admin App operation, etc.
-
Activate Security
This page describes how to activate security.
Pre-configured Sample
Security is enabled when building the sample app. Explore / test it as described in Authorization.
Automatic - sqlite Auth Provider
Activate security using the ApiLogicServer add-auth
command.
Suggestion: you can test it using the sample without customizations, as follows:
ApiLogicServer create --project_name=nw --db_url=nw-
cd nw
ApiLogicServer add-auth
Test it as described in Authorization.
Note the use of db_url=nw-
to create the sample, without customization or security.
If you are new to API Logic Server, this is a good way to observe basic project creation. You can use the
ApiLogicServer add-cust
command to add customizations and security after you explore the basic project.
This command will:
- Add the sqlite database and models, using
ApiLogicServer add-db --db_url=auth --bind_key=authentication
- This uses Multi-Database Support for the sqlite authentication data
- Add User.Login endpoint to the User model
- Set
SECURITY_ENABLED
inconfig.py
- Add Sample authorizations to security/declare_security.py
Manual Configuration
To configure security:
- Declare Grants
- Paste into your
security/declare_security.py
from this sample
- Paste into your
- Set
SECURITY_ENABLED = True
in config.py - Configure your Authentication-Provider, using your own Authentication-Provider,
Appendix: Internals
The Security Manager and sqlite Authentication-Provider are built into created projects from the system's prototype project.