Skip to content

Conversation

@westin-m
Copy link
Contributor

No description provided.

@jennyf19
Copy link
Collaborator

Thanks @westin-m :shipit:

Copy link
Collaborator

@jmprieur jmprieur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thanks @westin-m

@jennyf19
Copy link
Collaborator

tested with:

  services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
                        .AddMicrosoftIdentityWebApi(options =>
                        {
                            options.Events = new JwtBearerEvents
                            {
                                OnMessageReceived = (context) =>
                                {
                                    Console.WriteLine("[OnMessageReceived]");
                                    return Task.CompletedTask;
                                }
                            };
                        }, options =>
                        {
                            options.TenantId = "7f58f645-c190-4ce5-9de4-e2b7acd2a6ab";
                            options.Instance = "https://login.microsoftonline.com/";
                            options.ClientId = "a4c2469b-cf84-4145-8f5f-cb7bacf814bc";
                        }, JwtBearerDefaults.AuthenticationScheme)
                        .EnableTokenAcquisitionToCallDownstreamApi(options => { options.ClientSecret = "secret-of-web-api"; })
#if UseRedisCache
                     //.AddDistributedTokenCaches();
#else
            .AddInMemoryTokenCaches();
            

@westin-m westin-m merged commit fa7b30b into master Sep 18, 2023
@westin-m westin-m deleted the westinm/chainMsgEvent branch September 18, 2023 16:11
This was referenced Aug 15, 2025
This was referenced Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Different behaviour in raising JwtBearerEvents between 2.13.1 and 2.13.2

4 participants