# 查询身份提供商
#### 功能介绍
查询身份提供商列表。
#### URI
GET /v1/identity-providers
#### 请求参数
无
#### 响应参数
**状态码：200**
表1响应Body参数 
| 参数                 | 参数类型                                                                                                         | 描述                                                                                                                                                           |
|:---|:---|:---|
| identity_providers | Array of [IdentityProviderListSummary] objects | **参数解释**： 身份提供者列表。 **取值范围**： 不涉及。 |
   
 表2IdentityProviderListSummary 
| 参数                | 参数类型                                                                       | 描述                                                                                                                                                                                                      |
|:---|:---|:---|
| identity_provider | String                                                                     | **参数解释**： 身份提供者编码，用于唯一标识一个身份提供者。 **取值范围**： 只能由英文字母、数字及"-"、"_"组成，长度为1\~64个字符。 |
| display_name      | String                                                                     | **参数解释**： 身份提供商的名称。 **取值范围**： 不涉及。                                           |
| oauth2_discovery  | [Oauth2Discovery] object | **参数解释**： OAuth2提供商的发现信息（UNION类型）。 **取值范围**： 不涉及。                            |
   
 表3Oauth2Discovery 
| 参数                            | 参数类型                                                                                                           | 描述                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|
| discovery_url                 | String                                                                                                         | **参数解释**： OpenID Connect发现地址（Discovery URL），用于获取身份提供商的OIDC配置信息，包括签发者地址、JWKS端点等。 **取值范围**： 必须以https://开头，且以/.well-known/openid-configuration结尾，长度为1\~2048个字符。 |
| authorization_server_metadata | [Oauth2AuthorizationServerMetadata] object | **参数解释**： OAuth2提供商的授权服务器元数据。 **取值范围**： 不涉及。                                                                                                                 |
   
 表4Oauth2AuthorizationServerMetadata 
| 参数                          | 参数类型             | 描述                                                                                                                                                                                          |
|:---|:---|:---|
| authorization_endpoint      | String           | **参数解释**： 授权服务器的授权端点。 **取值范围**： 必须以https://开头，长度为1\~2048个字符。     |
| issuer                      | String           | **参数解释**： 授权服务器的签发者标识。 **取值范围**： 必须以https://开头，长度为1\~2048个字符。    |
| token_endpoint              | String           | **参数解释**： 授权服务器的令牌端点。 **取值范围**： 必须以https://开头，长度为1\~2048个字符。     |
| response_types              | Array of strings | **参数解释**： 支持的响应类型列表。 **取值范围**： 数组长度范围\[1,20\]，每个元素为1\~50个字符的字符串。 |
| token_endpoint_auth_methods | Array of strings | **参数解释**： 令牌端点支持的客户端认证方法列表。 **取值范围**： 数组长度范围\[1,2\]。             |
   
#### 请求示例
查询身份提供商列表。
```
GET https://{endpoint}/v1/identity-providers
```
#### 响应示例
**状态码：200**
```
{
  "identity_providers" : [ {
    "identity_provider" : "MicrosoftOauth2",
    "display_name" : "Microsoft",
    "oauth2_discovery" : {
      "discovery_url" : "https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration"
    }
  }, {
    "identity_provider" : "GoogleOauth2",
    "display_name" : "Google",
    "oauth2_discovery" : {
      "discovery_url" : "https://accounts.google.com/.well-known/openid-configuration"
    }
  }, {
    "identity_provider" : "GithubOauth2",
    "display_name" : "GitHub",
    "oauth2_discovery" : {
      "authorization_server_metadata" : {
        "authorization_endpoint" : "https://github.com/login/oauth/authorize",
        "issuer" : "https://token.actions.githubusercontent.com",
        "token_endpoint" : "https://github.com/login/oauth/access_token",
        "response_types" : [ "code", "token", "id_token", "code token", "code id_token", "token id_token", "code token id_token" ],
        "token_endpoint_auth_methods" : [ "client_secret_post", "client_secret_basic" ]
      }
    }
  } ]
}
```
#### 状态码
| 状态码 | 描述    |
|:---|:---|
| 200 | 请求成功。 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-agentidentity/ErrorCode.html)。
