You might want to just add the “identities” array as a custom claim to the ID token and go about getting it that way - Here’s an action that does this for example:
Hey there @huthefa.alfararjeh thanks for getting back to me - Sorry for not being more clear in my previous response. I was suggesting a method for adding the identities array directly to the user’s ID token.
If I’m understanding the code you shared correctly, you’re using the Auth0.Swift SDK’s management client to get a user. Currently it looks like you’re specifically requesting the user_metadata attribute and only that. Have you tried adding identities to fields? I believe the way the method works is that if you include specific attributes in the request, any others not specified are excluded. Perhaps try the following:
let userInfo = try await Auth0
.users(token: accessToken)
//only line changed to include "identities"
.get(userSub, fields: ["user_metadata", "identities"])
.start()
let userMetadata = userInfo["user_metadata"] as? [String: String?] ?? ["": ""]
let identityValues = userInfo["identities"] as? [[String: Any]] ?? []
let isSocial = identityValues.compactMap { Identity(json: $0) }.contains{ $0.social }