Enabling trusted authentication

Before embedding CDV Services within client pages, you must first enable trusted authentication on the CDV Server.

  1. Add the following settings to the advanced site settings.
    INSTALLED_APPS = INSTALLED_APPS + ('trustedauth',)
          
    AUTHENTICATION_BACKENDS = (
          'django.contrib.auth.backends.ModelBackend',
          'trustedauth.backends.TrustedAuthBackend'
    )
          
    TRUSTED_AUTH = {
          'trusted_ips': ['127.0.0.1'],
          'trusted_users': ['tadmin'],
          'timeout': 120,
          'single_use': True,
          'session_expiry': 0,
          'allow_superuser': True
    }
    

    Settings explanation:

    trusted_ips:

    A list of trusted IPs. Ticket requests from these IP addresses are validated. You can either specify a list of trusted_ips, a list of trusted_users, or both.

    trusted_users:

    A list of trusted ticket-granting usernames. You can either specify a list of trusted_users, a list of trusted_ips, or both.

    timeout:

    The time that the ticket remains valid, in seconds.

    single_use:

    The ticket can be used only one time.

    session_expiry:

    The duration time of the user session, in seconds. A setting of 0 ends the user session when the browser closes.

    allow_superuser:

    Allows authentication of a user with admin privileges using a ticket. Set this to False to disable this feature.

  2. Restart the application to apply the new configuration.