Quantcast
Channel: Asp.NET Identity 2 giving "Invalid Token" error - Stack Overflow
Browsing latest articles
Browse All 25 View Live

Answer by NitinT for Asp.NET Identity 2 giving "Invalid Token" error

I faced same issue if I click on reset link that I got in email after 10 mins. The DataProtectionTokenProviderOptions --> TokenLifespan was set to 10 mins.I changed...

View Article



Answer by walter33 for Asp.NET Identity 2 giving "Invalid Token" error

I have experienced Invalid token in Reset password scenario. The root cause was, that I was generating reset token for for incorrect IndentityUser. It can be spotted easily in simplified code, but it...

View Article

Answer by walter33 for Asp.NET Identity 2 giving "Invalid Token" error

I have solved "Invalid Token" issue most of described hints. Here is my solution for blazor project. The core is in StringExtensions class.Generating email when user is registering his/her email:user =...

View Article

Answer by Krusty for Asp.NET Identity 2 giving "Invalid Token" error

Insipired by the soluion #3 posted by @cheny, I realized that if you use the same UserManager instance the generated code is accepted. But in a real scenario, the validation code happens in a second...

View Article

Answer by San Jaisy for Asp.NET Identity 2 giving "Invalid Token" error

In case anyone runs into this, it turns out that the token was not URL-friendly, and so I had to wrap it in a HttpUtility.UrlEncode() like so:var callback =...

View Article


Answer by developer d for Asp.NET Identity 2 giving "Invalid Token" error

The following solution helped me in WebApi:Registrationvar result = await _userManager.CreateAsync(user, model.Password);if (result.Succeeded) {EmailService emailService = new EmailService();var url =...

View Article

Answer by Matt for Asp.NET Identity 2 giving "Invalid Token" error

Hit this issue with asp.net core and after a lot of digging I realised I'd turned this option on in Startup:services.Configure<RouteOptions>(options =>{ options.LowercaseQueryStrings =...

View Article

Answer by Chris Bechette for Asp.NET Identity 2 giving "Invalid Token" error

Related to chenny's 3. Different instances of token providers . In my case I was passing IDataProtectionProvider.Create a new guid every time it got called, which prevented existing codes from being...

View Article


Answer by cyptus for Asp.NET Identity 2 giving "Invalid Token" error

tl;dr: Register custom token provider in aspnet core 2.2 to use AES encryption instead of MachineKey protection, gist: https://gist.github.com/cyptus/dd9b2f90c190aaed4e807177c45c3c8bi ran into the same...

View Article


Answer by Ajit Goel for Asp.NET Identity 2 giving "Invalid Token" error

My issue was that I was missing a <input asp-for="Input.Code" type="hidden" /> control in my Reset Password form <form role="form" method="post"><div asp-validation-summary="All"...

View Article

Answer by Nacht for Asp.NET Identity 2 giving "Invalid Token" error

My problem was that there was a typo in the email containing the ConfirmationToken:<p>Please confirm your account by <a href=@ViewBag.CallbackUrl'>clicking here</a>.</p>This...

View Article

Answer by Diego Garcia for Asp.NET Identity 2 giving "Invalid Token" error

Here I've the same problem but after a lot of time I found that in my case the invalid token error was raised by the fact that my custom Account class has the Id property re-declared and overridden....

View Article

Answer by sailen for Asp.NET Identity 2 giving "Invalid Token" error

In my case, I just need to do HttpUtility.UrlEncode before sending an email. No HttpUtility.UrlDecode during reset.

View Article


Answer by Damion for Asp.NET Identity 2 giving "Invalid Token" error

Here is what I did: Decode Token after encoding it for URL (in short) First I had to Encode the User GenerateEmailConfirmationToken that was generated. (Standard above advice) var token = await...

View Article

Answer by user9296906 for Asp.NET Identity 2 giving "Invalid Token" error

We have run into this situation with a set of users where it was all working fine. We have isolated it down to Symantec's email protection system which replaces links in our emails to users with safe...

View Article


Answer by Mathemats for Asp.NET Identity 2 giving "Invalid Token" error

Make sure that the token that you generate doesn't expire rapidly - I had changed it to 10 seconds for testing and it would always return the error. if (dataProtectionProvider != null) {...

View Article

Answer by Josep Alacid for Asp.NET Identity 2 giving "Invalid Token" error

Maybe this is an old thread but, just for the case, I've been scratching my head with the random occurrence of this error. I've been checking all threads about and verifying each suggestion but...

View Article


Answer by user3812699 for Asp.NET Identity 2 giving "Invalid Token" error

In my case, our AngularJS app converted all plus signs (+) to empty spaces ("") so the token was indeed invalid when it was passed back. To resolve the issue, in our ResetPassword method in the...

View Article

Answer by Tebogo Johannes for Asp.NET Identity 2 giving "Invalid Token" error

string code = _userManager.GeneratePasswordResetToken(user.Id); code = HttpUtility.UrlEncode(code);//send rest emaildo not decode the code var result = await _userManager.ResetPasswordAsync(user.Id,...

View Article

Answer by mendel for Asp.NET Identity 2 giving "Invalid Token" error

I was getting the "Invalid Token" error even with code like this:var emailCode = UserManager.GenerateEmailConfirmationToken(id);var result = UserManager.ConfirmEmail(id, emailCode);In my case the...

View Article

Answer by cheny for Asp.NET Identity 2 giving "Invalid Token" error

I encountered this problem and resolved it. There are several possible reasons.1. URL-Encoding issues (if problem occurring "randomly")If this happens randomly, you might be running into url-encoding...

View Article


Answer by Alex T for Asp.NET Identity 2 giving "Invalid Token" error

Other than that, I've seen the code itself fail if it's not encoded.I've recently started encoding mine in the following fashion:string code = manager.GeneratePasswordResetToken(user.Id);code =...

View Article


Answer by Wolf for Asp.NET Identity 2 giving "Invalid Token" error

Make sure when generate, you use: GeneratePasswordResetTokenAsync(user.Id)And confirm you use:ResetPasswordAsync(user.Id, model.Code, model.Password)If you make sure you are using the matching methods,...

View Article

Answer by trailmax for Asp.NET Identity 2 giving "Invalid Token" error

Because you are generating token for password reset here:string code = UserManager.GeneratePasswordResetToken(user.Id);But actually trying to validate token for email: result = await...

View Article

Asp.NET Identity 2 giving "Invalid Token" error

I'm using Asp.Net-Identity-2 and I'm trying to verify email verification code using the below method. But I am getting an "Invalid Token" error message. My Application's User Manager is like...

View Article

Browsing latest articles
Browse All 25 View Live




Latest Images