CAS 6.5.x 配置企业微信扫码委托认证,cas.authn.pac4j.oauth2[0].profileUrl 不知道怎么传递参数,无法获取用户信息。
cas.properties相关配置如下:
cas.authn.pac4j.oauth2[0].id=wxdf38d888888888
cas.authn.pac4j.oauth2[0].customParams.appid=wxdf38888888
cas.authn.pac4j.oauth2[0].customParams.agentid=1000027
cas.authn.pac4j.oauth2[0].customParams.response_type=code
cas.authn.pac4j.oauth2[0].customParams.scope=snsapi_login
cas.authn.pac4j.oauth2[0].secret=Bwc5kYxM70sh1DSCB8el8888888888888888
cas.authn.pac4j.oauth2[0].authUrl=https://open.work.weixin.qq.com/wwopen/sso/qrConnect
cas.authn.pac4j.oauth2[0].tokenUrl=https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=wxdf3888888888&corpsecret=Bwc5kYxM788888888888888888888888
cas.authn.pac4j.oauth2[0].profileUrl=https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo
cas.authn.pac4j.oauth2[0].profileVerb=GET
cas.authn.pac4j.oauth2[0].principal-attribute-id=UserId
cas.authn.pac4j.oauth2[0].clientName=WorkWeChat
前面没有问题,点击CAS登录页 WORKWECHAT 进入扫码页,成功返回 code 和 access_token, 下一步获取用户信息时,
https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo需要带上前一步获取的 code 和 access_token, 才能返回用户信息,
如果profileUrl能写成这样:
cas.authn.pac4j.oauth2[0].profileUrl=https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token={ACCESS TOKEN}&code={code}
就能成功返回用户信息了。
profileURL可以有参数,但只能是静态值,而code 和 access_token是动态的,大家有解决方案吗?
怎么把前一步获取的 code code 和 access_token作为 profile URL的参数?具体的配置是?