Azure-docs: Authenticate with Azure Active Directory - Error " New-Object: Cannot find type [Microsoft.IdentityModel.Clients.ActiveDirectory.SecureClientSecret]: verify that the assembly containing this type is loaded."

Created on 19 Jun 2020  Â·  6Comments  Â·  Source: MicrosoftDocs/azure-docs

Hello,

I'm following the steps in the link below to perform authentication by AAD, but I received the error message "New-Object: Cannot find type [Microsoft.IdentityModel.Clients.ActiveDirectory.SecureClientSecret]: verify that the assembly containing this type is loaded".

Does anyone know how to solve this issue?

image

Reference: https://docs.microsoft.com/en-us/azure/cognitive-services/authentication#authenticate-with-azure-active-directory

Best regards,
Cristina


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 assigned-to-author cognitive-servicesvc doc-bug triaged

All 6 comments

@crisansou we will review your feedback and get back to you shortly. Thanks.

@erhopf I was able to reproduce this error when trying to get a token. Can you please review documentation? Thanks.

image

@crisansou - We're looking into this for you now and will get back to you as soon as we have an answer.

@crisansou, if you are using CloudShell from Azure Portal, the SecureClientSecret class is not available. You can, however, pass in the secret as a string. So you can do: $clientCredential = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.ClientCredential" -ArgumentList $app.ApplicationId,

More info on ClientCredential can be found here:
https://docs.microsoft.com/en-us/dotnet/api/microsoft.identitymodel.clients.activedirectory.clientcredential.-ctor?view=azure-dotnet-preview#Microsoft_IdentityModel_Clients_ActiveDirectory_ClientCredential__ctor_System_String_System_String_

We'll update the doc accordingly so other folks don't run into the same issue. Thanks for bringing this to our attention!

$clientCredential = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.ClientCredential" -ArgumentList $app.ApplicationId,

Ok, it worked, thank you!

Best regards,
Cristina

We're in the process of updating docs and @crisansou is unblocked - #please-close

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

jharbieh picture jharbieh  Â·  3Comments

mrdfuse picture mrdfuse  Â·  3Comments

ianpowell2017 picture ianpowell2017  Â·  3Comments

jamesgallagher-ie picture jamesgallagher-ie  Â·  3Comments