Oauth 2通用提供程序模板示例 [英] Oauth 2 Generic Provider Template Examples

查看:48
本文介绍了Oauth 2通用提供程序模板示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看Azure门户中可能的连接提供程序,我确定我的用例需要"OAuth 2通用提供程序"(而不是通用OAuth 2"提供程序).但是,我似乎找不到任何有关模板应如何工作或将哪些变量传递到模板的文档.

Looking over the possible connection provider in Azure Portal, I've determined that my use case requires the the "OAuth 2 Generic Provider" (rather than the "Generic OAuth 2" provider). However, I can't seem to find any documentation on how the templating should work or what variables are passed to the template.

我正在尝试与Azure DevOps建立连接.首先,我尝试使用通用OAuth 2"提供程序,并且测试流程完成,直到botframework的令牌服务从Azure DevOps接收授权代码为止.它会将我重定向到错误请求"页面.我可以从重定向的URL中获取授权代码,并按照Azure DevOps文档中的说明构造令牌调用,并且该令牌调用可以正常工作,因此我猜测这是botframework的令牌服务如何调用Azure DevOps的问题,因此为什么我需要使用"OAuth 2通用提供程序",因为它允许我指定令牌服务如何调用Azure DevOps.

I'm attempting to setup a connection with Azure DevOps. First I tried using the "Generic OAuth 2" provider and the test flow works up until the botframework's token service receives the authorization code from Azure DevOps. It'll redirect me to a "Bad Request" page. I can take the authorization code from the redirected url and construct the token call as Azure DevOps' documentation describes and it works correctly so I'm guessing this is an issue with how the botframework's token service is calling Azure DevOps hence why I need to use the "OAuth 2 Generic Provider" since it allows me to specify how the token service calls Azure DevOps.

理想情况下,这将被添加到文档中的某个地方,或者甚至更好地作为Azure门户页面上的提示.

Ideally, this would be added to the documentation somewhere or - even better - as hints on the Azure portal page.

添加了页面的屏幕截图.您在该表单的模板"字段中输入了什么?

Added a screenshot of the page. What do you put in the "Template" fields on that form?

推荐答案

该表格背后的团队已经得到我的认可.在这里评论任何在Google上搜索相似内容的人.

I got a hold of the team behind that form. Commenting here for anyone that searches for something similar on Google.

这些是对我有用的值,您需要设置自己的id/秘密/范围

These are the values that worked for me, you'll need to set your own id/secrets/scopes

  • 范围列表定界符:
  • 授权URL模板: https://app.vssps.visualstudio.com/oauth2/authorize
  • 授权URL查询字符串模板:?client_id = {ClientId}& response_type = Assertion& state = {State}& scope = {Scopes}& redirect_uri = {RedirectUrl}
  • >
  • 令牌URL模板: https://app.vssps.visualstudio.com/oauth2/token
  • 令牌URL查询字符串模板:?
  • 令牌主体模板: client_assertion_type = urn:ietf:params:oauth:client-assertion-type:jwt-bearer& client_assertion = {ClientSecret}& grant_type = urn:ietf:params:oauth:grant-type:jwt-bearer& assertion = {Code}& redirect_uri = {RedirectUrl}
  • 刷新URL模板: https://app.vssps.visualstudio.com/oauth2/token
  • 刷新URL查询字符串模板:?
  • 刷新主体模板: client_assertion_type = urn:ietf:params:oauth:client-assertion-type:jwt-bearer& client_assertion = {ClientSecret}& grant_type = refresh_token& assertion = {RefreshToken}& redirect_uri{RedirectUrl}
  • Scope List Delimiter: ,
  • Authorization URL Template: https://app.vssps.visualstudio.com/oauth2/authorize
  • Authorization URL Query String Template: ?client_id={ClientId}&response_type=Assertion&state={State}&scope={Scopes}&redirect_uri={RedirectUrl}
  • Token URL Template: https://app.vssps.visualstudio.com/oauth2/token
  • Token URL Query String Template: ?
  • Token Body Template: client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&client_assertion={ClientSecret}&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion={Code}&redirect_uri={RedirectUrl}
  • Refresh URL Template: https://app.vssps.visualstudio.com/oauth2/token
  • Refresh URL Query String Template: ?
  • Refresh Body Template: client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&client_assertion={ClientSecret}&grant_type=refresh_token&assertion={RefreshToken}&redirect_uri={RedirectUrl}

这篇关于Oauth 2通用提供程序模板示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆