import json
import base64


def encode_token(token):
    """
    Encodes dictionaries into an "opaque" string.
    """
    json_string = json.dumps(token)
    return base64.b64encode(json_string.encode('utf-8')).decode('utf-8')