def sub_claims(oper, args): res = get_id_tokens(oper.conv) try: res.extend(oper.conv.cache["id_token"]) except (KeyError, ValueError): pass idt, _ = res[-1] _sub = idt["sub"] oper.req_args["claims"] = {"id_token": {"sub": {"value": _sub}}}
def id_token_hint(oper, kwargs): res = get_id_tokens(oper.conv) try: res.extend(oper.conv.cache["id_token"]) except (KeyError, ValueError): pass idt, jwt = res[0] oper.req_args["id_token_hint"] = jwt