- Development Integration
- /
- SDK
- /
- Java
- /
Management module
- /
Manage users
- /
- Get the user's external identity source
¶ Get the user's external identity source
Update time: 2025-07-23 07:34:21
This document is automatically generated based on https://github.com/authing/authing-docs-factory and the https://api-explorer.genauth.ai V3 API, and is consistent with the API parameters and return results. If the document description is incorrect, please refer to the V3 API.
Use the user ID to obtain the user's external identity source and select the specified user ID type.
¶ Method Name
ManagementClient.getUserIdentities
¶ Request Parameters
| Name | Type | Is it required | Default Value | Description | Example Value |
|---|---|---|---|---|---|
| userId | string | Yes | - | The unique identifier of the user. It can be Yes user ID, user name, email address, mobile phone number, externalId, or ID in the external identity source. For details, see the description of the userIdType field. The default is user id. | 6229ffaxxxxxxxxcade3e3d9 |
| userIdType | string | No | user_id | User id type, the default value is user_id, the optional values are:- user_id: GenAuth user ID, such as 6319a1504f3xxxxf214dd5b7- phone: user phone number- email: user email- username: user name- external_id: user ID in the external system, corresponding to the externalId field of GenAuth user information- identity: user's external identity source information, the format is <extIdpId>:<userIdInIdp>, where <extIdpId> is the ID of the GenAuth identity source, and <userIdInIdp> is the ID of the user in the external identity source.Example Value: 62f20932716fbcc10d966ee5:ou_8bae746eac07cd2564654140d2a9ac61.- sync_relation: The user's external identity source information, in the format of <provier>:<userIdInIdp>, where <provier> is the synchronization identity source type, such as wechatwork, lark; <userIdInIdp> is the user's ID in the external identity source.Example Value: lark:ou_8bae746eac07cd2564654140d2a9ac61. | user_id |
¶ Sample Code
package test.management;
import cn.authing.sdk.java.client.ManagementClient;
import cn.authing.sdk.java.dto.GetUserIdentitiesDto;
import cn.authing.sdk.java.dto.IdentityListRespDto;
import cn.authing.sdk.java.model.ManagementClientOptions;
import cn.authing.sdk.java.util.JsonUtils;
public class GetUserIdentitiesTest {
// Need to be replaced with your GenAuth Access Key ID
private static final String ACCESS_KEY_ID = "AUTHING_ACCESS_KEY_ID";
// Need to be replaced with your GenAuth Access Key Secret
private static final String ACCESS_KEY_SECRET = "AUTHING_ACCESS_KEY_SECRET";
public static void main(String[] args) throws Throwable {
ManagementClientOptions clientOptions = new ManagementClientOptions();
clientOptions.setAccessKeyId(ACCESS_KEY_ID);
clientOptions.setAccessKeySecret(ACCESS_KEY_SECRET);
// If you are a private deployment customer, you need to set the GenAuth service domain name
// clientOptions.setHost("https://api.your-authing-service.com");
ManagementClient client = new ManagementClient(clientOptions);
GetUserIdentitiesDto reqDto = new GetUserIdentitiesDto();
reqDto.setUserId("6229ffaxxxxxxxxcade3e3d9");
IdentityListRespDto response = client.getUserIdentities(reqDto);
System.out.println(JsonUtils.serialize(response));
}
}
¶ Request Response
Type: IdentityListRespDto
| Name | Type | Description |
|---|---|---|
| statusCode | number | Business status code, which can be used to determine whether the operation is successful. 200 means success. |
| message | string | Description |
| apiCode | number | Segmented error code, which can be used to get the specific error type (successful requests are not returned). For a detailed list of error codes, see: API Code List (opens new window) |
| requestId | string | Request ID. Returned when the request fails. |
| data | array | Response data |
Example Results:
{
"statusCode": 200,
"message": "Operation successful",
"requestId": "934108e5-9fbf-4d24-8da1-c330328abd6c",
"data": {
"identityId": "62299d8b866d2dab79a89dc4",
"extIdpId": "6076bacxxxxxxxxd80d993b5",
"provider": "wechat",
"type": "openid",
"userIdInIdp": "oj7Nq05R-RRaqak0_YlMLnnIwsvg",
"accessToken": "57_fK0xgSL_NwVlS-gmUwlMQ2N6AONNIOAYxxxx",
"refreshToken": "57_IZFu91Ak1Wg6DRytZFFIOd3upNF5lH7vPxxxxx",
"originConnIds": "[\"605492ac41xxxxe0362f0707\"]"
}
}
¶ Data Structure
¶ IdentityDto
| Name | Type | Is it required | Description | Example Value |
|---|---|---|---|---|
| identityId | string | Yes | Identity source ID | 62299d8b866d2dab79a89dc4 |
| extIdpId | string | Yes | Identity source connection ID | 6076bacxxxxxxxxd80d993b5 |
| provider | string | Yes | External identity source Type: - wechat: WeChat- qq: QQ- wechatwork: WeChat for Business- dingtalk: DingTalk- weibo: Weibo- github: GitHub- alipay: Alipay- baidu: Baidu- lark: Feishu- welink: Welink- yidun: NetEase Yidun- qingcloud: Qingyun- google: Google- gitlab: GitLab- gitee: Gitee- twitter: Twitter- facebook: Facebook- slack: Slack- linkedin: Linkedin- instagram: Instagram- oidc: OIDC-type enterprise identity source- oauth2: OAuth2-type enterprise identity source- saml: SAML-type enterprise identity source- ldap: LDAP-type enterprise identity source- ad: AD-type enterprise identity source- cas: CAS-type enterprise identity source- azure-ad: Azure AD-type enterprise identity source | oidc |
| type | string | Yes | Identity type, such as unionid, openid, primary | openid |
| userIdInIdp | string | Yes | ID in the external identity source | oj7Nq05R-RRaqak0_YlMLnnIwsvg |
| userInfoInIdp | object | Yes | User's identity information in idp | |
| accessToken | string | No | Access Token in the external identity source (this parameter is only returned when the user actively obtains it, and the management side interface will not return it). | 57_fK0xgSL_NwVlS-gmUwlMQ2N6AONNIOAYxxxx |
| refreshToken | string | No | Refresh Token in the external identity source (this parameter is only returned when the user actively obtains it, and the management side interface will not return it). | 57_IZFu91Ak1Wg6DRytZFFIOd3upNF5lH7vPxxxxx |
| originConnIds | array | Yes | List of identity origin connection IDs that the identity comes from | ["605492ac41xxxxe0362f0707"] |
