def get_token_auth_header(request):
    """Obtains the Access Token from the Authorization Header"""
    auth_header = request.headers.get("Authorization")
    if not auth_header:
        raise ValueError("Authorization header is expected")

    parts = auth_header.split()

    if parts[0].lower() != "bearer":
        raise ValueError("Authorization header must start with Bearer")
    elif len(parts) == 1:
        raise ValueError("Token not found")
    elif len(parts) > 2:
        raise ValueError("Authorization header must be Bearer token")

    token = parts[1]
    return token