Azure 总线与基于 GO 的应用程序集成

Azure bus integration with GO based application

我们正在尝试从 "GO" 语言应用程序连接到 Azure 服务总线实体,并且可以通过提供 SAS 令牌或 Azure AD OAuth2.0 令牌与 Azure 服务总线实体集成,这些令牌将通过安全负责人。从技术上讲,我更喜欢安全主体选项而不是 SAS 令牌,因为它存在安全漏洞。

如何使用 "GO" 之类的语言从 Azure AD 获取 OAuth2.0 令牌,而 Azure AD SDK 不可用?

是否可以直接调用 Azure AD REST API 来访问 OAuth2.0 令牌?如果是,一些代码示例会有所帮助,否则请提出合适的选择。

这里有 available authentication methods 的 Go。

另外,您可以直接调用获取访问令牌。

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

参考:

OAuth 2.0 客户端凭据授予

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