Skip to content

Error when using B2C integration (inc. Example). Can't load Microsoft.IdentityModel.Tokens #6

@msivers

Description

@msivers

Simple to reproduce - just use the example Function App with TokenAzureB2COptions and results in error:

Exception while executing function: GetUser. AzureExtensions.FunctionToken: Could not load file or assembly 'Microsoft.IdentityModel.Tokens, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

Here is my startup code for B2C (albeit with altered uris)...

builder.AddAzureFunctionsToken(new TokenAzureB2COptions()
{
    AzureB2CSingingKeyUri = new Uri("https://myidp.b2clogin.com/myidp.onmicrosoft.com/discovery/v2.0/keys?p=B2C_1_policy"),
    Audience = "https://myidp.onmicrosoft.com/98d8e0a8-8713-4bb7-8247-82010affa1d1",
    Issuer = "https://myidp.onmicrosoft.com/2351f626-3e64-46bf-baf8-d5096f3b5261/v2.0/"
});

The above is using the Nuget package...
<PackageReference Include="AzureExtensions.FunctionToken" Version="1.0.11" />

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions