0

I'm trying to log into Azure from my application to get some blob from Azure Blob. The Azure.Identity nugget package has some methods for that, like some TokenCredentials class and, what I wanted to use, UsernamePasswordCredential Class, which an example of it's constructor called is something like this:

    private TokenCredential GetAzureBlobTokenCredential(DataProtectionSettings options)
    {
        return new UsernamePasswordCredential(options.AzureUser, options.AzurePass, options.AzureTenantId, options.AzureClientId);
    }

But it seems that I cannot use it without a tenantId and clientId (passing the params as null returns a NullArgumentException). I would like to use an "admin" user and pass without the need of registering the applications, because this will be a traversal user used in different apps. It's that possible? Is there an alternative? Or should I stick with the tenantId and clientId?

xecollons
  • 536
  • 6
  • 22

1 Answers1

3

You always need to register an application. To acquire a token, you need a client id.

juunas
  • 54,244
  • 13
  • 113
  • 149
  • Since there is no other answer, I'll assume that that is correct and you can't have a token without a clientId. We'll, I'll have to go through it. Thanks. – xecollons Oct 04 '21 at 13:20