Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using this method to generate a password reset link. Everything works great but the callback URL has a huge token. I was asked if there was a way to reduce the length of URL.
As this is a framework generated code, i could not do much.
You can find this implementation in any MVC 5 template by default.

await UserManager.GeneratePasswordResetTokenAsync()


Please share your opinions if there is any way to achieve this using still the same method.


Thanks in advance for your time and effort.
Posted
Comments
Sergey Alexandrovich Kryukov 21-Oct-14 22:56pm    
What's so bad about huge token, if the procedure guarantees required safety?
—SA
MohseenJ 22-Oct-14 13:47pm    
Hello Sergey, i understand your concern. I too felt the same way that it would b more secure with having framework create code. But that seems too long to user.
Sergey Alexandrovich Kryukov 22-Oct-14 14:10pm    
The user should not directly type this URL and does not even have to see it...
—SA
MohseenJ 22-Oct-14 14:26pm    
I am sending this url in Email.. And there are two formats of email.. Html format for sure user will not see it. But the plain text format user is able to see.. Please suggest if there is any work around

1 solution

I was wondering if something like TinyURL http://tinyurl.com/[^] would help, but, they don't have an API

I wonder if there's any service 'like that' that has a API - or can be used 'programmatically' - maybe screen-scraping to their site, but you would have to heck the terms and conditions etc first

[update] there a discussion here on SO that *might* give some more options [/update] http://stackoverflow.com/questions/3671043/methods-of-reducing-url-size[^]
 
Share this answer
 
v2
Comments
MohseenJ 22-Oct-14 13:49pm    
Thanks for your reply Garth. I will refer to the link you posted.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900