The authenticate method takes credentials as keyword arguments,
        usually username/email and password.

        Returns a user model if the Stormpath authentication was successful or
        None otherwise. It expects three variable to be defined in Django
        settings: \n
            STORMPATH_ID = "apiKeyId" \n
            STORMPATH_SECRET = "apiKeySecret" \n
            STORMPATH_APPLICATION =
            "https://api.stormpath.com/v1/applications/APP_UID"

def authenticate(self, username=None, password=None, **kwargs):
        """The authenticate method takes credentials as keyword arguments,
        usually username/email and password.

        Returns a user model if the Stormpath authentication was successful or
        None otherwise. It expects three variable to be defined in Django
        settings: \n
            STORMPATH_ID = "apiKeyId" \n
            STORMPATH_SECRET = "apiKeySecret" \n
            STORMPATH_APPLICATION =
            "https://api.stormpath.com/v1/applications/APP_UID"
        """
        if username is None:
            UserModel = get_user_model()
            username = kwargs.get(UserModel.USERNAME_FIELD)

        account = self._stormpath_authenticate(username, password)
        if account is None:
            return None

        return self._create_or_get_user(account)