Authentication

Authentication apis

The action handlers can check how the request is authenticated and who is requesting a URL with following methods defined in aalam_common.auth.

  • deny_anonymous_user(request)

    Deny if the requesting client is an anonymous user. Anonymous users are those who does not have a valid authentication token or cookie.

  • get_auth_user(request)

    This method returns the email if of the user requesting an URL. The user can be an internal application in which the email id with be of that of the application.

  • is_auth_internal(request)

    Check if the request is from internal source. The internal request can be made only by the applications running in the same portal in which the application calling this method is running.

  • is_auth_external(request)

    Any request that authenticated but originates from a remote program like the aalam central server or the apps server or some remote applications that have valid authenticatoin tokens are considered external requests.

  • get_app_email(provider_code, app_code)

    This method returns an application’s email id with it’s provider_code and app_code.