Python 烧瓶+;OIDC&x2B;keydove,keydove用户会话删除未经授权的端点

Python 烧瓶+;OIDC&x2B;keydove,keydove用户会话删除未经授权的端点,python,flask,python-requests,keycloak,openid-connect,Python,Flask,Python Requests,Keycloak,Openid Connect,我想使用KeyClope会话删除端点删除用户的会话 http://localhost:8080/auth/admin/realms/master/sessions/ 会话\状态我从会话数据中获取,会话数据是存储在KeyClope中的会话id 钥匙斗篷正在运行中http://localhost:8080 我的代码现在看起来像 session_delete_url = http://localhost:8080/auth/admin/realms/master/sessions/<sessio

我想使用KeyClope会话删除端点删除用户的会话

http://localhost:8080/auth/admin/realms/master/sessions/

会话\状态我从会话数据中获取,会话数据是存储在KeyClope中的会话id

钥匙斗篷正在运行中http://localhost:8080

我的代码现在看起来像

session_delete_url = http://localhost:8080/auth/admin/realms/master/sessions/<session_state>
res = requests.delete(session_delete_url,headers={"Authorization": "Bearer {}".format(request.cookies.get("oidc_id_token"))})
    if res.status_code in [200, 204]:
        logging.info(f"{res.text}")
    else:
        logging.info(f"{res.text}")
session\u delete\u url=http://localhost:8080/auth/admin/realms/master/sessions/
res=requests.delete(session\u delete\u url,headers={“Authorization”:“Bearer{}”.format(request.cookies.get(“oidc\u id\u token”))
如果[200204]中的res.status_代码:
logging.info(f“{res.text}”)
其他:
logging.info(f“{res.text}”)
我遇到了错误{ “错误”:“HTTP 401未经授权” }

用户会话数据

{“永久”:True,“oidc_csrf_令牌”:“D9Tfrcu-98b-PNng8m2CR86-2ASP7k-0”,“7f680e7c-dc8c-4dbb-bbd1-114dbab06f75”:“访问令牌”:“EYJHBGIUZI1NIISINR5CIGOAISL”,“客户端id”:“测试前端”,“客户端机密”:“eb13be11-0b7d-”,“刷新令牌”:“EYJHBGIUJIUZIZIZI5CIGIUIZI1NIISINR5CIGOAISL”,“客户端id”:“测试前端密钥”:“eb13be11-0b7d-”,“刷新令牌”:“EYJJJJJZIZIZIZIZIZIZIZIZIZIZIZIZIZIZIZIZIZIZI,“令牌uri”:http://localhost:8080/auth/realms/master/protocol/openid-连接/令牌,“用户\代理”:null,“撤销\ uri”:https://oauth2.googleapis.com/revoke“,“id_令牌”:{“exp”:1620121063,“iat”:1620121003,“认证时间”:1620120965,“jti”:“65c4c31e-d2a1-4ebc-98c”,“iss”:”http://localhost:8080/auth/realms/master“,”aud“:”测试前端“,”子“:“7f680e7c-dc8c-4dbb-bbd1-114dbab06f75”,“类型”:“ID”,“azp”:“测试前端”,“会话状态”:“f13ccb9d-fb4d-46d3-9993-394a3b1c4aaf”,“at_散列”:“b_RH4ERCSVVAQ_SH5OQ”,“acr”:“0”,“电子邮件已验证”:false,“名称”:“adminfirst adminlast”,“首选用户名”:“admin”,“已知姓名”:“adminfirst”,“家族名”:“adminlast”,“电子邮件”:”"admintest@gmail.com},“id_token_jwt”:“eyJhbGciOiJSUzI1NiIsInR5cCIgO”,“token_response”:{“access_token”:“eyJhbG_jVWw”,“expires_in”:60,“refresh_expires_in”:1800,“refresh_token”:“edn_jpE5jxnePEUAyv-vfA”,“token_类型”:“持有者”,“id_token”:“EYJBGCIOJUI1NIISINR5CG-2A”,“不在策略之前”:0,“会话状态”:”f13ccb9d-fb4d-46d3-9993-394a3b1c4aaf,“范围”:“openid配置文件电子邮件”},“范围”:[“openid”,“电子邮件”],“令牌信息uri”:https://oauth2.googleapis.com/tokeninfo,“无效”:false,“_类”:“OAuth2Credentials”,“_模块”:“oauth2client.client”}”

cookies数据

不可变多指令([('session','925f7a7b-d5b9-4035-adbe-a70fed0202a0'),('oidc_id_token','eyJhbGciOiJIU'))

我应该在标题中进行哪些更改,以获得授权并删除会话

提前谢谢