Casbin = way to authorization
A place for Casbin developers and users
现在注册
已注册用户请  登录
主题样式选择
默认主题样式 ✅
知乎主题样式 
admin
Casnode  ›  问与答

get session

  •  
  •  
    admin · 2年前 · 74 次点击 
    这是一个创建于 876 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Hi aevery one! What I do: 1. I get access token from api/get-token 2. Than I decode access token and get some user info, name, id, etc. 3. After I try to get user by id, owner and userId over api method /api/get-user, it's take me error - Unauthorized operation A see that request in swagger sending cookie in headers, I take cookie session_id from swagger request, put it to my request headers and it's ok, request was successfuly, but for this I must be authorised on web site, if I not loggined in web site, my request was fail. I think what I must do: 1. Try to get session by api method - api/get-session 2. If is not found, creating new session by api method - api/add-session 3. Put finded or created session id to my request I wrote this code, but: 1. If I try to get session, I take error - waw-casdoor:GetOwnerAndNameFromId() error, wrong token count for ID: my_org_name/my_app_name/my_user_name 2. When I try to create new session, I take error too - Unauthorized operation How can I get user info?

    74 次点击  ∙  0 人收藏  
      Tweet Weibo 忽略主题 
    1 条回复   2023-09-13 11:33:27 +08:00
    admin
    admin2年前

    回复图片 1694575999.png

    关于   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   50 人在线   最高记录 50   ·     选择语言  ·     选择编辑器
    创意工作者们的社区
    World is powered by code
    VERSION: c3b0ae8 · 29ms · UTC 20:58 · PVG 04:58 · LAX 13:58 · JFK 16:58
    ♥ Do have faith in what you're doing.