Solved

asp.net mvc5 OWIN

Posted on 2016-08-18
3
30 Views
Last Modified: 2016-08-18
Guys,

I implemented owin authentication user and all works  fine. I have one problem that i can't figure how to implement.

i'm trying to reset password for user, and the only things the framework provided is  this method:
example:
Usermanager.ResetPassword(model.Id, code, model.Password);

I would like to reset the password without passing any token and sent email to user. what I would like to do is to reset the password and tell user what is new password :).
There is a way to do it that way?
0
Comment
Question by:Moti Mashiah
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
Moti Mashiah earned 0 total points
ID: 41761310
As usual I found my solution by myself --useless website :)
Here is the solution:

var Usermanager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(context));

            Usermanager.RemovePassword(model.Id);
            Usermanager.AddPassword(model.Id, model.Password);

Open in new window

0
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 41761318
I don't think you've thought this out.
1. A password is a secret.  The only way two people can keep a secret is if one is dead.
2. Most systems don't store the plaintext password. They store a salted hash of the password this means that you can't send the user the password.  If you go to a site and the site does offer you the recovery method which sends you the password it is insecure.
3. Implementing your proposed method allows someone other than the user to change the password. Another no-no. See Point #1
0
 
LVL 1

Author Comment

by:Moti Mashiah
ID: 41761334
Thank you for your message, but I think that I didn't explained all my scenario.

I'm building this authentication for internal users and my requirements was to let only the Admin the access of managing users.

In the solution I provide the Admin will not be able to know the password users have as its stored in the database as a hashing password or reset, but he will be able to remove and add new password to the default password the company agree on, then the user in the first login will type the default password and will require to change the password to the one he likes(of course depend on policy).

Let me know if you still see any concern regarding this implementation.

"Kinda of active directory logic"

Thanks,
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now