Auth0 Home Blog Docs

OnTicketReceived is never triggered


#1

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


#3

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


#4

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.


#5

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!


#6

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.


#7

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


#8

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


#9

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!


#10

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.


#11

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


#14

@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.

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!


#15

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