microsoft-authentication-library-for-go icon indicating copy to clipboard operation
microsoft-authentication-library-for-go copied to clipboard

[Documentation] - Using the Access Token gained from AcquireTokenByAuthCode

Open KuljitAthwal opened this issue 3 years ago • 1 comments

Documentation related to component

Public Client App

Please check all that apply

  • [ ] typo
  • [ ] documentation doesn't exist
  • [ ] documentation needs clarification
  • [ ] error(s) in the example
  • [x] needs an example

Description of the issue

I'm using two libraries together;

  • github.com/AzureAD/microsoft-authentication-library-for-go/apps/public
  • github.com/microsoftgraph/msgraph-sdk-go

I use public to create a public client type, an auth url and ultimately handle the auth code and request for an access token I want to use msgraph-sdk-go to query the graph apis

I've been following the examples in the documentations. However I'm looking for examples on how to use this access token to call the Azure APIs, or even the Graph API using the msgraph-sdk-go.

I know that with the msgraph-sdk-go you can create a cred using the tenant id, client id, auth code and redirect url, but this feels like duplicate work when I have an access token already.

I also accept that this may be outside of the remit of this library

Kind regards, Kuljit

KuljitAthwal avatar Nov 30 '21 16:11 KuljitAthwal

Apologies I see on the youtube video the same error report and a suggestion to run the command with the -Verbose switch, here is a snippet of the output:

VERBOSE: Processing delegate permissions for Microsoft.OfficeModernCalendar VERBOSE: Processing delegate permissions for GitHub Subscription Permission Validation VERBOSE: Querying Entra ID for object 'cb8269ca-ff6a-4b90-814d-a949fd0f18b1' VERBOSE: Object not found. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. VERBOSE: Processing delegate permissions for SharePoint Online Client Extensibility Web Application Principal VERBOSE: Processing delegate permissions for Request Approvals Read Platform VERBOSE: Processing delegate permissions for Targeted Messaging Service VERBOSE: Processing delegate permissions for Box VERBOSE: Querying Entra ID for object 'abaf5c19-7abe-4a1b-8852-cc98b5030a48' VERBOSE: Object not found. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. VERBOSE: Querying Entra ID for object '8076c81e-25d2-4e9a-9cc4-50006652b295' VERBOSE: Object not found. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. VERBOSE: Processing delegate permissions for Office 365 Configure VERBOSE: Processing delegate permissions for Bot Service CMEK Prod VERBOSE: Processing delegate permissions for Microsoft Flow Service VERBOSE: Processing delegate permissions for Arc Token Service VERBOSE: Processing delegate permissions for Meeting Catchup Recommendations V2 VERBOSE: Processing delegate permissions for AssistAPI VERBOSE: Processing delegate permissions for MCAPI Authorization Prod VERBOSE: Processing delegate permissions for One Outlook Web VERBOSE: Processing delegate permissions for Networking-MNC VERBOSE: Processing delegate permissions for BenefitsFD VERBOSE: Processing delegate permissions for sp-azr-dell-sps-dev-0001 VERBOSE: Processing delegate permissions for Power Query Online GCC-L2 VERBOSE: Processing delegate permissions for Office 365 Import Service VERBOSE: Processing delegate permissions for Microsoft Intune PowerShell VERBOSE: Querying Entra ID for object '6605fe3a-d08d-4bc9-b44c-507890a3e2dd' VERBOSE: Object not found. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. VERBOSE: Querying Entra ID for object '6605fe3a-d08d-4bc9-b44c-507890a3e2dd' VERBOSE: Object not found. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. VERBOSE: Querying Entra ID for object '8076c81e-25d2-4e9a-9cc4-50006652b295' VERBOSE: Object not found. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. VERBOSE: Querying Entra ID for object '8076c81e-25d2-4e9a-9cc4-50006652b295' VERBOSE: Object not found. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. VERBOSE: Querying Entra ID for object '8076c81e-25d2-4e9a-9cc4-50006652b295' VERBOSE: Object not found. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. VERBOSE: Querying Entra ID for object '8076c81e-25d2-4e9a-9cc4-50006652b295' VERBOSE: Object not found. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. VERBOSE: Querying Entra ID for object '8076c81e-25d2-4e9a-9cc4-50006652b295' VERBOSE: Object not found. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. VERBOSE: Querying Entra ID for object '8076c81e-25d2-4e9a-9cc4-50006652b295' VERBOSE: Object not found. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. VERBOSE: Querying Entra ID for object '8076c81e-25d2-4e9a-9cc4-50006652b295' VERBOSE: Object not found. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. VERBOSE: Querying Entra ID for object '8076c81e-25d2-4e9a-9cc4-50006652b295' VERBOSE: Object not found. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. VERBOSE: Querying Entra ID for object '8076c81e-25d2-4e9a-9cc4-50006652b295' VERBOSE: Object not found. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. VERBOSE: Processing delegate permissions for Customer Experience Platform CDPA Provisioning PROD VERBOSE: Processing delegate permissions for Office Change Management VERBOSE: Processing delegate permissions for aziotops.init.22743639127f4f8e861a8cfb8e52a7bb VERBOSE: Processing delegate permissions for Microsoft Azure VERBOSE: Processing delegate permissions for Azure Iot Hub VERBOSE: Processing delegate permissions for boxprodmicrosoftteamsuswest-boxforteams VERBOSE: Processing delegate permissions for Azure Multi-Factor Auth Client VERBOSE: Processing delegate permissions for Azure Monitor Control Service VERBOSE: Processing delegate permissions for HIS AAD Private Clouds App VERBOSE: Processing delegate permissions for Microsoft.EventHubs VERBOSE: Processing delegate permissions for Office Python Service MSA and AAD VERBOSE: Processing delegate permissions for SubstrateActionsService VERBOSE: Processing delegate permissions for AzNS EventHub Action VERBOSE: Processing delegate permissions for Marketplace Api VERBOSE: Processing delegate permissions for mncdurock4sek3s VERBOSE: Processing delegate permissions for Azure API Management VERBOSE: Processing delegate permissions for AvsOnFleetRP VERBOSE: Processing delegate permissions for Frontline Worker Orchestrator Service VERBOSE: Processing delegate permissions for Office Shredding Service VERBOSE: Processing delegate permissions for Azure Machine Learning Singularity VERBOSE: Processing delegate permissions for Microsoft Teams Targeting Application VERBOSE: Processing delegate permissions for Microsoft.Relay VERBOSE: Processing delegate permissions for Azure Device Registry VERBOSE: Processing delegate permissions for Messaging Augmentation Application VERBOSE: Processing delegate permissions for Azure SQL Managed Instance to Microsoft.Network VERBOSE: Processing delegate permissions for Jarvis Transaction Service VERBOSE: Processing delegate permissions for Permission Service O365 VERBOSE: Processing delegate permissions for ClusterConfigToConnectedCluster VERBOSE: Processing delegate permissions for KCS-UserRP VERBOSE: Processing delegate permissions for Adobe Acrobat VERBOSE: Querying Entra ID for object '6605fe3a-d08d-4bc9-b44c-507890a3e2dd' VERBOSE: Object not found. VERBOSE: Querying Entra ID for object 'd5b7d276-de11-45f2-ba4e-a4cb67fa0809' VERBOSE: Object not found. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists. VERBOSE: Querying Entra ID for object '8076c81e-25d2-4e9a-9cc4-50006652b295' VERBOSE: Object not found. VERBOSE: Querying Entra ID for object 'd5b7d276-de11-45f2-ba4e-a4cb67fa0809'

Not every Object not found generates an error only some of them do.

colinrippeyfinarne avatar Feb 06 '24 11:02 colinrippeyfinarne

i too get the same error when I run against a very large EntraID tenent.

mmascolino avatar Feb 22 '24 21:02 mmascolino