I have a Blazor .Net 5 app using Identity Platform authentication. Out of the box this all works fine, however, I would like to fire my own methods after .Net/AzureAD does it thing, but I am not sure how to best do this.
So the user clicks a "sign in" link, that targets @MicrosoftIdentity/Account/SignIn", MS takes over and handles everything, and return to the callbackPath "/signin-oidc" as per the instructions to set this up. How can I get the following code to run immediately after this process completes?
MyCustomPostSignInLogic()
{
// All my code to run once, post sign in
}
As an additional ability, is there also a way to intervene .Net automatically sigining the user in, despite them being authenticated?
MyCustomOverrideSignInLogic()
{
// run this code and perhaps decide not to authenticate a user, despite them successfully completing MS auth. Maybe we have blacklisted a user, and despite them having a valid MS account, don't want them to specifically authenticate against our app.
}