Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chain the OnMessageReceived event #2468

Merged
merged 1 commit into from
Sep 18, 2023
Merged

Chain the OnMessageReceived event #2468

merged 1 commit into from
Sep 18, 2023

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
5 checks passed
@westin-m westin-m deleted the westinm/chainMsgEvent branch September 18, 2023 16:11
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
3 participants