Solved

asp.net mvc5 OWIN

Posted on 2016-08-18
3
37 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DataGridView Events ? 3 37
VB.Net How to Exit Sub - Exit Form??? 5 47
Connection String 16 41
WCF Service Application cannot connect from TCP terminal 1 11
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

929 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

10 Experts available now in Live!

Get 1:1 Help Now