Skip to content

Activation

Except for the sample project, projects are created with security disabled. So, a typical project creation sequence might be:

  1. Create your project without security

    • Verify connectivity, API operation, Admin App operation, etc.
  2. 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:

  1. Add the sqlite database and models, using ApiLogicServer add-db --db_url=auth --bind_key=authentication
  2. Add User.Login endpoint to the User model
  3. Set SECURITY_ENABLED in config.py
  4. Add Sample authorizations to security/declare_security.py

 

Manual Configuration

To configure security:

  1. Declare Grants
    • Paste into your security/declare_security.py from this sample
  2. Set SECURITY_ENABLED = True in config.py
  3. 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.