你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

O Auth Providers - Create Or Update

创建或更新 oauthProvider 资源。

PATCH {endpoint}/oauth/providers/{oauthProviderId}?api-version=2023-11-01-preview

URI 参数

名称 必需 类型 说明
endpoint
path True

string

uri

命名空间的主机名,例如 admaInstanceName.farmbeats.azure.net

oauthProviderId
path True

string

oauthProvider 资源的 ID。

api-version
query True

string

请求的 API 版本

请求头

Media Types: "application/merge-patch+json"

名称 必需 类型 说明
Authorization True

string

请为授权的 API 调用提供有效的持有者令牌。 请注意,如果之前尝试过未经身份验证的调用,则可能需要清除浏览器缓存。

请求正文

Media Types: "application/merge-patch+json"

名称 类型 说明
apiKey

string

给定提供程序的 OAuth Api 密钥。 注意:目前适用于气候提供商。 不会发送响应。

appId

string

给定 OAuth 提供程序的 OAuth 应用 ID。

appSecret

string

给定提供程序的 OAuth 应用机密。 注意:不会在响应中发送。

description

string

资源的文本说明。

isProductionApp

boolean

一个可选标志,用于确定应用是否已准备好用于提供程序端的生产方案。 (默认值:false) 注意:当前适用于 JohnDeere。

name

string

用于标识资源的名称。

properties

属于资源的键值对的集合。 每对的键不能超过 50 个字符,并且值不能大于 150 个字符。 注意:最多可以为资源提供 25 个键值对,并且仅支持字符串、数字和日期时间 (yyyy-MM-ddTHH:mm:ssZ) 值。

响应

名称 类型 说明
200 OK

OAuthProvider

Success

201 Created

OAuthProvider

创建

Other Status Codes

ErrorResponse

错误

Headers

x-ms-error-code: string

安全性

Authorization

请为授权的 API 调用提供有效的持有者令牌。 请注意,如果之前尝试过未经身份验证的调用,则可能需要清除浏览器缓存。

Type: apiKey
In: header

示例

OAuthProviders_CreateOrUpdate

Sample Request

PATCH {endpoint}/oauth/providers/JOHNDEERE?api-version=2023-11-01-preview

{
  "appId": "appId",
  "appSecret": "appSecret",
  "apiKey": "apiKey",
  "isProductionApp": false,
  "name": "JOHNDEERE",
  "description": "some description",
  "properties": {
    "orgId": "ORG123"
  }
}

Sample Response

{
  "id": "JOHNDEERE",
  "appId": "appId",
  "appSecret": "appSecret",
  "apiKey": "apiKey",
  "isProductionApp": false,
  "name": "JOHNDEERE",
  "description": "some description",
  "properties": {
    "orgId": "ORG123"
  },
  "eTag": "0f8fad5b-d9cb-469f-a165-70867728950e",
  "createdDateTime": "2021-04-23T11:31:10Z",
  "modifiedDateTime": "2021-04-23T11:31:10Z"
}
{
  "id": "JOHNDEERE",
  "appId": "appId",
  "appSecret": "appSecret",
  "apiKey": "apiKey",
  "isProductionApp": false,
  "name": "JOHNDEERE",
  "description": "some description",
  "properties": {
    "orgId": "ORG123"
  },
  "eTag": "0f8fad5b-d9cb-469f-a165-70867728950e",
  "createdDateTime": "2021-04-23T11:31:10Z",
  "modifiedDateTime": "2021-04-23T11:31:10Z"
}

定义

名称 说明
Error

Azure AgPlatform 服务出错。

ErrorResponse

来自 Azure AgPlatform 服务的错误响应。 有关 ErrorResponse 参考文档,请参阅 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses

InnerError

包含错误列表的内部错误。有关 InnerError 参考文档,请参阅 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object

OAuthProvider

OAuth 提供程序资源的架构。

Error

Azure AgPlatform 服务出错。

名称 类型 说明
code

string

服务器定义的错误代码集。

details

Error[]

有关导致此报告错误的特定错误的详细信息数组。

innererror

InnerError

包含错误列表的内部错误。有关 InnerError 参考文档,请参阅 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object

message

string

错误的用户可读表示形式。

target

string

错误的目标。

ErrorResponse

来自 Azure AgPlatform 服务的错误响应。 有关 ErrorResponse 参考文档,请参阅 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses

名称 类型 说明
error

Error

Azure AgPlatform 服务出错。

traceId

string

唯一跟踪 ID。

InnerError

包含错误列表的内部错误。有关 InnerError 参考文档,请参阅 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object

名称 类型 说明
code

string

包含错误提供的特定错误代码。

innererror

InnerError

包含错误列表的内部错误。有关 InnerError 参考文档,请参阅 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object

OAuthProvider

OAuth 提供程序资源的架构。

名称 类型 默认值 说明
apiKey

string

给定提供程序的 OAuth Api 密钥。 注意:目前适用于气候提供商。 不会发送响应。

appId

string

给定 OAuth 提供程序的 OAuth 应用 ID。

appSecret

string

给定提供程序的 OAuth 应用机密。 注意:不会在响应中发送。

createdBy

string

由用户/租户 ID 创建。

createdDateTime

string

创建资源的日期时间,示例格式:yyyy-MM-ddTHH:mm:ssZ。

description

string

资源的文本说明。

eTag

string

用于实现乐观并发的 ETag 值。

id

string

唯一的 OAuth 提供程序 ID。

isProductionApp

boolean

False

一个可选标志,用于确定应用是否已准备好用于提供程序端的生产方案。 (默认值:false) 注意:当前适用于 JohnDeere。

modifiedBy

string

由用户/租户 ID 修改。

modifiedDateTime

string

上次修改资源的日期时间,示例格式:yyyy-MM-ddTHH:mm:ssZ。

name

string

用于标识资源的名称。

properties

属于资源的键值对的集合。 每对的键不能超过 50 个字符,并且值不能大于 150 个字符。 注意:最多可以为资源提供 25 个键值对,并且仅支持字符串、数字和日期时间 (yyyy-MM-ddTHH:mm:ssZ) 值。