Dear Sir,
We want to know that following facility's are available in our application.
User should get prompt to change the password after 30 days (if log in after 30 days). User should not allow to use last five password .
Thanks.
10 Answer(s)
-
0
Hi,
Currently there's no such password policy. We are planning to implement those features in the future but there's no timeline for now.
-
0
OK then tell me that, How can i archive this functionality.
Some other related query's.
- how can i encrypt decrypt password using apb framework.
- we are thinking that to create login audit table( at database end )- then how can i check password is exist in that table.
- where can i implement this logic..... (Log in page, which controller)
-
0
We want to get last log in datetime(at the time of user log in ) from database but some difficulties over there.
see url (pdf) for more info
[https://drive.google.com/file/d/0BzSirtYGe7EHRUE2OVNlQ3FQZ0E/view?usp=sharing])
-
0
Hi @velu,
For your last question, you need to get user from database before this line:
var loginResult = await GetLoginResultAsync(loginModel.UsernameOrEmailAddress, loginModel.Password, GetTenancyNameOrNull());
You can do it by using AbpSession.TenantId and given username/email address.
Thanks.
-
0
Hi @velu,
I will try to answer your questions:
- how can i encrypt decrypt password using apb framework. You can inject
private readonly IPasswordHasher<User> _passwordHasher;
and then use
var hashedPassword = _passwordHasher.HashPassword(user, plainPassword);
we are thinking that to create login audit table( at database end )- then how can i check password is exist in that table. You can hash given password and query db with it.
where can i implement this logic..... (Log in page, which controller) Yes, you need to implement it in Account Controller's Login action.
Thanks.
-
0
<cite>ismcagdas: </cite> Hi @velu,
For your last question, you need to get user from database before this line:
var loginResult = await GetLoginResultAsync(loginModel.UsernameOrEmailAddress, loginModel.Password, GetTenancyNameOrNull());
You can do it by using AbpSession.TenantId and given username/email address.
Thanks.
Dear Sir,
as per your reply
You are not providing any code for accessing database record.
I found that in your code or database The field name LastLogintime [Table : abpusers] is a current login time not lastlog in time.
Also i check through code
var lstLogTime = UserManager.FindByIdAsync((long)AbpSession.UserId); var retTime = (lstLogTime).Result.LastLoginTime;
in above code "retTime " is current log in time.
and also this line of code has current login time.
var loginResult = await GetLoginResultAsync(loginModel.UsernameOrEmailAddress, loginModel.Password, GetTenancyNameOrNull());
-
0
<cite>ismcagdas: </cite> Hi @velu,
I will try to answer your questions:
- how can i encrypt decrypt password using apb framework. You can inject
private readonly IPasswordHasher<User> _passwordHasher;
and then use
var hashedPassword = _passwordHasher.HashPassword(user, plainPassword);
we are thinking that to create login audit table( at database end )- then how can i check password is exist in that table. You can hash given password and query db with it.
where can i implement this logic..... (Log in page, which controller) Yes, you need to implement it in Account Controller's Login action.
Thanks.
how can i validate hashed password on the database.
-
0
Hi @velu,
When you run this line:
var loginResult = await GetLoginResultAsync(loginModel.UsernameOrEmailAddress, loginModel.Password, GetTenancyNameOrNull());
And if it is successfull, it updates user's LastLoginTime as well.
You can use UserManager's "FindByNameOrEmailAsync" method to find user before this line. In that way, you can get correct LastLoginTime.
how can i validate hashed password on the database.
Can you explain this a bit more ?
Thanks.
-
0
Dear all,
We are implemented following functionalities in our application.
User should get prompt to change the password after 30 days (if log in after 30 days).. User should not allow to use last five password .
thanks :idea:
-
0
Thanks for the feedback @velu :)