import base64
import json


def get_kid(encoded_jwt):
    """Get the ALB (K)ey (ID) from a JWT
    :param encoded_jwt: The encoded_jwt from the request headers
    :returns: a key id
    :rtype: str
    Example 'kid': '307a30c3-8280-4ff5-a78d-6bc5263ffbe8'
    """
    jwt_headers = encoded_jwt.split(".")[0]
    decoded_jwt_headers = base64.b64decode(jwt_headers)
    decoded_jwt_headers = decoded_jwt_headers.decode("utf-8")
    decoded_json = json.loads(decoded_jwt_headers)
    kid = decoded_json["kid"]
    return kid