'Checks a console auth token and returns the related connect info.'

def _show(self, req, id, rdp_only):

    context = req.environ['nova.context']
    context.can(cat_policies.BASE_POLICY_NAME)
    token = id
    if (not token):
        msg = _('token    not    provided')
        raise webob.exc.HTTPBadRequest(explanation=msg)
    connect_info = self._consoleauth_rpcapi.check_token(context, token)
    if (not connect_info):
        raise webob.exc.HTTPNotFound(explanation=_('Token    not    found'))
    console_type = connect_info.get('console_type')
    if (rdp_only and (console_type != 'rdp-html5')):
        raise webob.exc.HTTPUnauthorized(explanation=_('The    requested    console    type    details    are    not    accessible'))
    return {'console': {i: connect_info[i] for i in ['instance_uuid', 'host', 'port', 'internal_access_path'] if (i in connect_info)}}
