def get_new_token(self, netloc):
        """Get a new token from BIG-IP and store it internally.

        Throws relevant exception if it fails to get a new token.

        This method will be called automatically if a request is attempted
        but there is no authentication token, or the authentication token
        is expired.  It is usually not necessary for users to call it, but
        it can be called if it is known that the authentication token has
        been invalidated by other means.
        """
        login_body = {
            'username': self.username,
            'password': self.password,
        }

        if self.auth_provider:
            if self.auth_provider == 'local':
                login_body['loginProviderName'] = 'local'
            elif self.auth_provider == 'tmos':
                login_body['loginProviderName'] = 'tmos'
            elif self.auth_provider not in ['none', 'default']:
                providers = self.get_auth_providers(netloc)
                for provider in providers:
                    if self.auth_provider in provider['link']:
                        login_body['loginProviderName'] = provider['name']
                        break
                    elif self.auth_provider == provider['name']:
                        login_body['loginProviderName'] = provider['name']
                        break
        else:
            if self.login_provider_name == 'tmos':
                login_body['loginProviderName'] = self.login_provider_name

        login_url = "https://%s/mgmt/shared/authn/login" % (netloc)

        response = requests.post(
            login_url,
            json=login_body,
            verify=self.verify,
            auth=HTTPBasicAuth(self.username, self.password)
        )
        self.attempts += 1
        if not response.ok or not hasattr(response, "json"):
            error_message = '%s Unexpected Error: %s for uri: %s\nText: %r' %\
                            (response.status_code,
                             response.reason,
                             response.url,
                             response.text)
            raise iControlUnexpectedHTTPError(error_message,
                                              response=response)
        respJson = response.json()

        token = self._get_token_from_response(respJson)
        created_bigip = self._get_last_update_micros(token)

        try:
            expiration_bigip = self._get_expiration_micros(
                token, created_bigip
            )
        except (KeyError, ValueError):
            error_message = \
                '%s Unparseable Response: %s for uri: %s\nText: %r' %\
                (response.status_code,
                 response.reason,
                 response.url,
                 response.text)
            raise iControlUnexpectedHTTPError(error_message,
                                              response=response)

        try:
            self.expiration = self._get_token_expiration_time(
                created_bigip, expiration_bigip
            )
        except iControlUnexpectedHTTPError:
            error_message = \
                '%s Token already expired: %s for uri: %s\nText: %r' % \
                (response.status_code,
                 time.ctime(expiration_bigip),
                 response.url,
                 response.text)
            raise iControlUnexpectedHTTPError(error_message,
                                              response=response)
Get a new token from BIG-IP and store it internally.

        Throws relevant exception if it fails to get a new token.

        This method will be called automatically if a request is attempted
        but there is no authentication token, or the authentication token
        is expired.  It is usually not necessary for users to call it, but
        it can be called if it is known that the authentication token has
        been invalidated by other means.