OnTicketReceived is never triggered

I have a .NET Core web application where I have a custom login page. That all works fine. The only problem that I have is that the “OnTicketReceived” event in “OpenIdConnectEvents” (in my Startup.cs) is never invoked.

I was wondering if this is normal behaviour? Is there a way to trigger that event when using a custom login page?

PS. When I log out, then the “OnRedirectToIdentityProviderForSignOut” does get triggered. For some reason “OnTicketReceived” event never is.

Edit

As I understand this could have something to do with the CallbackPath setting? I have the following URLs in the Allowed Callback URLs configured:

https://localhost:44316/signin-auth0, http://localhost:1650/signin-auth0

Is it possible for you to provide a sample of your connection and auth code (with any sensitive information removed) for review?

Hi, I have added a striped down version of my project.

I couldn’t find an upload button here on the forum, so I’ve uploaded the project elsewhere: https://ufile.io/fus9x

If you could take a look, that would be great.

Edit
The funny thing is that the event OnRedirectToIdentityProviderForSignOut does get triggered when I log out. So I assume that the CallbackPath is correct?

Maybe also good to know is that I have the following settings:

Allowed Callback Urls:
https://localhost:44316/signin-auth0, http://localhost:1650/signin-auth0

Allowed Logout Urls:
https://localhost:44316/

Application type is: Regular Web Application

I allowed Grant Type Password for the application.

Other than that it’s default settings.

Hey there @ShoPeng! When you get a moment can you DM me your tenant name and a HAR file so we can dig deeper into what’s going on? Thanks in advance!

I wanted to touch base with you @ShoPeng and let you know that I am currently investigating this with our TSE team and will get back to you with a response.

Great, thanks a lot! Looking forward to your answer.

Hey there @ShoPeng can you please share a code sample of your Startup class when you get a moment? Thanks!

I wanted to follow up @ShoPeng and see if you had a chance to snag a code sample of your Startup class so we can take a deeper look at what’s going on? Thanks!

I was using the ‘custom login’ sample project from here: https://github.com/auth0-samples/auth0-aspnetcore-mvc-samples/tree/master/Samples/custom-login

From that project the OnRedirectToIdentityProvider never seems to be invoked. The same thing happens when you add the OnTicketReceived (or any other) event. The only one that seems to work is OnRedirectToIdentityProviderForSignOut.

I’m looking into this @ShoPeng and I will let you know what I find. Thanks!

@ShoPeng I have linked a sample below that you can leverage. Remove line 70 and 71 and implement and customize it as needed in your app.

https://github.com/auth0-samples/auth0-aspnetcore-mvc-samples/blob/master/Samples/custom-login/SampleMvcApp/Startup.cs#L70

Including this sample as reference as well.

If this doesn’t take care of the issue, can you please provide a direct snippet of the section. Thanks in advance!

I wanted to follow up and see if this helped answer your question @ShoPeng? Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.