?
Solved

asp.net mvc5 OWIN

Posted on 2016-08-18
3
Medium Priority
?
84 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 82

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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

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!
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

741 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