Search code examples
azure-active-directoryazureservicebusazure-servicebus-topicsazure-servicebus-subscriptions

Azure bus integration with GO based application


We are trying to connect to Azure service bus entity from "GO" language application & the integration with Azure service bus entity is possible by supplying either SAS token or Azure AD OAuth2.0 token which will be obtained via security principals. Technically I prefer security principals option rather than SAS token as it has security vulnerabilities.

How to acquire OAuth2.0 token from Azure AD using language like "GO" for which Azure AD SDK is not available?

Is it possible to make direct call to Azure AD REST APIs to access OAuth2.0 token? if yes some code sample would be helpful otherwise please suggest suitable options.


Solution

  • Here are available authentication methods for Go.

    Also, you can make a direct call to get the access token.

    https://login.microsoftonline.com/{tenant}/oauth2/token
    

    enter image description here

    Reference:

    OAuth 2.0 client credentials grant

    Authenticate and authorize an application with Azure Active Directory to access Azure Service Bus entities