Skip to content

Commit b583703

Browse files
authored
Merge pull request #8501 from NuAlex/docs-editor/error-code-AADSTS50020-user-ac-1742366601
AB#3962: Update error-code-AADSTS50020-user-account-identity-provider-does-not-exist.md
2 parents d867e17 + fd3360a commit b583703

1 file changed

Lines changed: 14 additions & 33 deletions

File tree

support/entra/entra-id/app-integration/error-code-AADSTS50020-user-account-identity-provider-does-not-exist.md

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.editor: v-jsitser
66
ms.reviewer: rrajan, haelshab, sungow, v-leedennis
77
ms.service: entra-id
88
ms.custom: sap:Issues Signing In to Applications, has-azure-ad-ps-ref
9-
keywords:
9+
keywords: AADSTS50020
1010
#Customer intent: As a Microsoft Entra administrator, I want to figure out why error code AADSTS50020 occurs so that I can make sure that my guest users from an identity provider can sign in to a resource tenant.
1111
---
1212
# Error AADSTS50020 - User account from identity provider does not exist in tenant
@@ -132,9 +132,9 @@ Use a tenant-specific endpoint (`https://login.microsoftonline.com/<TenantIDOrNa
132132

133133
Error `AADSTS50020` might occur if the name of a guest user who was deleted in a resource tenant is re-created by the administrator of the home tenant. To verify that the guest user account in the resource tenant isn't associated with a user account in the home tenant, use one of the following options:
134134

135-
### Verification option 1: Check whether the resource tenant's guest user is older than the home tenant's user account
135+
### Verification: Check whether the resource tenant's guest user is older than the home tenant's user account
136136

137-
The first verification option involves comparing the age of the resource tenant's guest user against the home tenant's user account. You can make this verification by using Microsoft Graph or MSOnline PowerShell.
137+
To check the creation date of the guest user account, you can use Microsoft Graph, Microsoft Entra PowerShell, or the Microsoft Graph PowerShell SDK.
138138

139139
#### Microsoft Graph
140140

@@ -155,45 +155,26 @@ GET https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/createdDateT
155155

156156
Then, check the creation date of the guest user in the resource tenant against the creation date of the user account in the home tenant. The scenario is confirmed if the guest user was created before the home tenant's user account was created.
157157

158-
#### MSOnline PowerShell
158+
#### Microsoft Entra PowerShell
159159

160-
> [!NOTE]
161-
> The [MSOnline PowerShell module](/powershell/azure/active-directory/install-msonlinev1) is set to be deprecated.
162-
> Because it's also incompatible with PowerShell Core, make sure that you're using a compatible PowerShell version so that you can run the following commands.
160+
Run the [Get-EntraUser](/powershell/module/microsoft.entra/get-entrauser) PowerShell cmdlet to review the user creation date, as follows:
163161

164-
Run the [Get-MsolUser](/powershell/module/msonline/get-msoluser) PowerShell cmdlet to review the user creation date, as follows:
165-
166-
```azurepowershell
167-
Get-MsolUser -SearchString [email protected] | Format-List whenCreated
162+
```powershell
163+
Get-EntraUser -UserId {id | userPrincipalName} | Select-Object id, userPrincipalName, createdDateTime
168164
```
169165

170166
Then, check the creation date of the guest user in the resource tenant against the creation date of the user account in the home tenant. The scenario is confirmed if the guest user was created before the home tenant's user account was created.
171167

172-
[!INCLUDE [Azure AD PowerShell deprecation note](~/../support/reusable-content/msgraph-powershell/includes/aad-powershell-deprecation-note.md)]
173-
174-
### Verification option 2: Check whether the resource tenant's guest alternative security ID differs from the home tenant's user net ID
175-
176-
> [!NOTE]
177-
> The [MSOnline PowerShell module](/powershell/azure/active-directory/install-msonlinev1) is set to be deprecated.
178-
> Because it's also incompatible with PowerShell Core, make sure that you're using a compatible PowerShell version so that you can run the following commands.
179-
180-
When a guest user accepts an invitation, the user's `LiveID` attribute (the unique sign-in ID of the user) is stored within `AlternativeSecurityIds` in the `key` attribute. Because the user account was deleted and created in the home tenant, the `NetID` value for the account will have changed for the user in the home tenant. Compare the `NetID` value of the user account in the home tenant against the key value that's stored within `AlternativeSecurityIds` of the guest account in the resource tenant, as follows:
168+
#### Microsoft Graph PowerShell SDK
181169

182-
1. In the home tenant, retrieve the value of the `LiveID` attribute using the `Get-MsolUser` PowerShell cmdlet:
170+
Run the [Get-MgUser](/powershell/module/microsoft.graph.users/get-mguser) PowerShell cmdlet to review the user creation date, as follows:
183171

184-
```azurepowershell
185-
Get-MsolUser -SearchString tuser1 | Select-Object -ExpandProperty LiveID
186-
```
187-
188-
1. In the resource tenant, convert the value of the `key` attribute within `AlternativeSecurityIds` to a base64-encoded string:
189-
190-
```azurepowershell
191-
[convert]::ToBase64String((Get-MsolUser -ObjectId 01234567-89ab-cdef-0123-456789abcdef
192-
).AlternativeSecurityIds.key)
193-
```
172+
```powershell
173+
$p = @('Id', 'UserPrincipalName', 'CreatedDateTime')
174+
Get-MgUser -UserId {id | userPrincipalName} -Property $p| Select-Object $p
175+
```
194176

195-
1. Convert the base64-encoded string to a hexadecimal value by using an online converter (such as [base64.guru](https://base64.guru/converter/decode/hex)).
196-
1. Compare the values from step 1 and step 3 to verify that they're different. The `NetID` of the user account in the home tenant changed when the account was deleted and re-created.
177+
Then, check the creation date of the guest user in the resource tenant against the creation date of the user account in the home tenant. The scenario is confirmed if the guest user was created before the home tenant's user account was created.
197178

198179
### Solution: Reset the redemption status of the guest user account
199180

0 commit comments

Comments
 (0)