如何在Android 3.0中在密码过期超时后强制用户更改passwd? [英] How to enforce user to change passwd after Password Expiration timeout in Android 3.0?

查看:78
本文介绍了如何在Android 3.0中在密码过期超时后强制用户更改passwd?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试通过使用Android密码过期功能 DeviceAdmin.当我调用setPasswordExpirationTimeout() API时,它仅 发送通知,实际上并没有强迫用户更改 密码.它仅在超时后发送通知:

I was trying to use Android Password expiration feature using DeviceAdmin. When I call setPasswordExpirationTimeout() API , it only sends a notification and doesn't actually force the user to change the password. It only sends a notification after timeout:

V/DevicePolicyManagerService(662):发送密码到期 行动通知 com.android.server.ACTION_EXPIRED_PASSWORD_NOTIFICATION

V/DevicePolicyManagerService( 662): Sending password expiration notifications for action com.android.server.ACTION_EXPIRED_PASSWORD_NOTIFICATION

您必须在DeviceAdminReceiver中获得回调 onPasswordExpired()强制用户更改密码.

You have to get the callback in DeviceAdminReceiver in onPasswordExpired() to force user to change password.

以这种方式实施的任何具体原因(或者仅仅是为了 赋予程序员灵活性)?

Any specific reason it's been implemented this way (or is it just to give flexibility to the programmer)?

我唯一看到的选择是在DeviceAdminReceiver的回调中以意图ACTION_SET_NEW_PASSWORD开始活动,用户只需按取消"按钮就可以撤消该行为.

The only option I could see is starting activity with intent ACTION_SET_NEW_PASSWORD in the callback in DeviceAdminReceiver which the user can overrule by simply pressing 'Cancel' button.

如何100%强制执行更改密码?

How to 100% enforce the to change password ?

推荐答案

您是否尝试过查看

Have you tried looking at the DeviceAdminSample (source code)? The Android SDK comes with all the samples so you can easily add the ApiDemos as an Eclipse project and run it in the simulator.

我本来以为您可以调用 DevicePolicyManager 中的rel ="nofollow"> resetPassword 方法a>,但是您需要用户输入新密码才能执行此操作,我认为您不想这样做!

I originally thought you could call the resetPassword method in the DevicePolicyManager, but you would need the user to have given you their new password to do that, which I assume you don't want to do!

这篇关于如何在Android 3.0中在密码过期超时后强制用户更改passwd?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆