Represents User identities obtained from external identity providers.
When a user authenticates using an external provider like Google OAuth, information from that provider will be made available as one of the user’s Identities. You can read more about the process in our identity linking guide.
type before making assumptions about the shape of the identity. Currently only OAuth identities are supported, but more types may be added in the future.
Get a list of identities associated with the user. A user can have multiple associated identities after going through identity linking. Currently only OAuth identities are supported. More provider types may be added in the future.
curl "https://api.workos.com/user_management/users/user_01E4ZCR3C56J083X43JQXF3JK5/identities" \ --header "Authorization: Bearer sk_example_123456789"
[ { "idp_id": "4F42ABDE-1E44-4B66-824A-5F733C037A6D", "type": "OAuth", "provider": "MicrosoftOAuth" } ]
| curl "https://api.workos.com/user_management/users/user_01E4ZCR3C56J083X43JQXF3JK5/identities" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const identities = await workos.userManagement.getUserIdentities( | |
| 'user_01E4ZCR3C56J083X43JQXF3JK5', | |
| ); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.user_management.get_user_identities(id: "user_01E4ZCR3C56J083X43JQXF3JK5") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.user_management.get_user_identities(id_="user_01E4ZCR3C56J083X43JQXF3JK5") |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.UserManagement().GetIdentities(context.Background(), "user_01E4ZCR3C56J083X43JQXF3JK5") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->userManagement() | |
| ->getUserIdentities(id: "user_01E4ZCR3C56J083X43JQXF3JK5"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.userManagement.getUserIdentities("user_01E4ZCR3C56J083X43JQXF3JK5"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.UserManagement.GetIdentitiesAsync("user_01E4ZCR3C56J083X43JQXF3JK5"); |
| use workos::Client; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .user_management() | |
| .get_user_identities("user_01E4ZCR3C56J083X43JQXF3JK5") | |
| .await?; | |
| Ok(()) | |
| } |
| [ | |
| { | |
| "idp_id": "4F42ABDE-1E44-4B66-824A-5F733C037A6D", | |
| "type": "OAuth", | |
| "provider": "MicrosoftOAuth" | |
| } | |
| ] |
GET/user_management /users /:id /identitiesParameters Returns object[]