如何使用“创建客户端 Oauth2 会话"生成 oauth 2.0 令牌机器人框架中的关键字 [英] How to generate oauth 2.0 token using "Create Client Oauth2 Session" keyword in robot framework
本文介绍了如何使用“创建客户端 Oauth2 会话"生成 oauth 2.0 令牌机器人框架中的关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Token&{head}=Create Dictionary Content-Type=application/x-www-form-urlencoded
Create Client Oauth2 Session temp token_url=https://websec-qa.cable.comcast.com/as/token.oauth2 tenant_id=customerequipmentqa tenant_secret=ac975251ba4349acbb962955876ec404 base_url=https://ce-service-qa.u1.app.cloud.comcast.net/xnet/ced/1.0/messages headers=&{head} verify=${True}
我收到以下错误:
MissingSchema:无效的 URL 'None':未提供架构
MissingSchema: Invalid URL 'None': No schema supplied
也许你的意思是 http://None?
推荐答案
Check Webservice
${token_string}= Set Variable Bearer
Create Session webservice ${BASE_TOKEN_URL} verify=${True}
${data}= Create Dictionary token_name=customerequipment grant_type=client_credentials client_id=customerequipmentqa client_secret=ac975251ba4349acbb962955876ec404 scope=xnet:customerequipment
${headers}= Create Dictionary Content-Type=application/x-www-form-urlencoded
${resp}= Post Request webservice /as/token.oauth2 data=${data} headers=${headers}
Should Be Equal As Strings ${resp.status_code} 200
${token}= evaluate $resp.json().get("access_token")
${stripped_token}= Strip String ${token}
${token_string}= Catenate ${token_string} ${stripped_token}
[Return] ${token_string}
这篇关于如何使用“创建客户端 Oauth2 会话"生成 oauth 2.0 令牌机器人框架中的关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文