Claims returns null

Rizwan Ansari 91 Reputation points
2021-10-11T06:35:16.487+00:00

Dear Experts,

After payment successful bank returns to my action method where i am checking user identity which gets null.
var claimsIdentity = (ClaimsIdentity)User.Identity;
var claim = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier);

please help

Microsoft Identity Manager
Microsoft Identity Manager
A family of Microsoft products that manage a user's digital identity using identity synchronization, certificate management, and user provisioning.
736 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,734 questions
0 comments No comments
{count} votes

Accepted answer
  1. AgaveJoe 29,281 Reputation points
    2021-10-11T14:02:27.927+00:00

    If I understand correctly, the bank API you are using makes a call back to your application after processing a user payment. If the bank is making an HTTP callback then an empty user identity is expected because the user did not make the call back (HTTP request), the bank made the call back.

    I recommend reading the payment API documentation that you are using. I assume the call back has user information that you can use to lookup the user.

    If this does not answer your question then provide minimal information about your payment provider and logic flow.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Rizwan Ansari 91 Reputation points
    2021-10-11T14:25:07.723+00:00

    Dear joe,

    Thanks a lot for reply. You are correct the back call back after payment is successful.
    In api they have some userdefined fields which can be passed in the call.
    What user identity should i have to pass with request?
    I am using arb payment gateway.

    Please help me to solve this issue.

    Thanks again.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.