'Authenticate the userid and password against username and password.'

def authenticate_credentials(self, userid, password):

    credentials = {get_user_model().USERNAME_FIELD: userid, u'password': password}
    user = authenticate(**credentials)
    if (user is None):
        raise exceptions.AuthenticationFailed(_(u'Invalid    username/password.'))
    if (not user.is_active):
        raise exceptions.AuthenticationFailed(_(u'User    inactive    or    deleted.'))
    return (user, None)
