I have generated TAP "$passcode=(New-MgUserAuthenticationTemporaryAccessPassMethod -UserId $UserPrincipalName -BodyParameter $params).TemporaryAccessPass" and I want validate/compare this generated Temporary access pass in another in powershell script

Shinde,Umesh,IN-Chennai 10 Reputation points
2023-04-11T15:32:16.94+00:00
  1. Currently i am generating TAP passcode using below line. $passcode=(New-MgUserAuthenticationTemporaryAccessPassMethod -UserId $UserPrincipalName -BodyParameter $params).TemporaryAccessPass
  2. Now, i am getting user's entered passcode on web page and comparing user entered correct passcode or wrong.
  3. How can we validate user's entered passcode with previous generated.
Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Authenticator
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CharanyaB-MSFT 1,891 Reputation points
    2023-04-12T12:52:49.7833333+00:00

    Hello @Shinde,Umesh,IN-Chennai,

    Thanks for reaching out!

    If the admin creates a new Temporary Access Pass for the user, the previous Temporary Access Pass will be deleted, and a new Temporary Access Pass will be created.

    Documentation reference: https://learn.microsoft.com/en-us/graph/api/authentication-post-temporaryaccesspassmethods?view=graph-rest-1.0&tabs=http

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.