0

we are trying to connect to azure postgres DB using AD & followed the instructions provided in the below documentation url https://learn.microsoft.com/en-us/azure/postgresql/howto-configure-sign-in-aad-authentication

Getting below error while connecting to postgres DB. I Manually validated the object id & tenant id of the user & tenant id of token we got using this "az account get-access-token --resource https://ossrdbms-aad.database.windows.net" command. both seems fine. still getting below error.

Azure AD access token not valid for role xxxxx@tenant.onmicrosoft.com (oid or appid claim does not match 9d8b7b0a-9139-4c86-a5f1-ed39134b8699) HINT: Did you specify the correct user name and access token?

ramz88
  • 30
  • 3
  • COuld you please tell me the user and the db are in the same tenant? – Jim Xu Nov 12 '20 at 03:41
  • Do you have any update? – Jim Xu Nov 13 '20 at 01:02
  • figured the problem, Access token which we got was from different user and hence the object id is not matched when we try do psql command. we must have logged into the right user in portal before we login in through CLI or shell in linuz VM using "az login", then make sure we logged in as to right az admin user by command"az ad signed-in-user show". same user must be added as ad admin under postgres DB. – ramz88 Nov 13 '20 at 06:17
  • Since your issuer has been resolved by yourself, could you please post your answer? – Jim Xu Nov 13 '20 at 06:47

0 Answers0