[ISSUE] Android Management API - Unable to remove the password from the device
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 03:12 AM
[REQUEST]
POST https://androidmanagement.googleapis.com/v1/enterprises/LC04k33pjm/devices/32931cb718c4bbcf:issueCom... HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json
{
"type": "RESET_PASSWORD"
}
[RESPONSE]
HTTP/1.1 200
cache-control: private
content-encoding: gzip
content-length: 263
content-type: application/json; charset=UTF-8
date: Tue, 07 May 2024 15:46:32 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"name": "enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operations/1715096792085",
"metadata": {
"@type": "type.googleapis.com/google.android.devicemanagement.v1.Command",
"type": "RESET_PASSWORD",
"createTime": "2024-05-07T15:46:32.085Z",
"duration": "600s",
"userName": "enterprises/LC04k33pjm/users/114476752020549114690"
}
}
Upon checking the status of the issued command "enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operations/1715096792085" in operations, I received a response.
[REQUEST]
GET https://androidmanagement.googleapis.com/v1/enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operatio... HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
[RESPONSE]
HTTP/1.1 200
cache-control: private
content-encoding: gzip
content-length: 304
content-type: application/json; charset=UTF-8
date: Tue, 07 May 2024 15:51:33 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"name": "enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operations/1715096792085",
"metadata": {
"@type": "type.googleapis.com/google.android.devicemanagement.v1.Command",
"type": "RESET_PASSWORD",
"createTime": "2024-05-07T15:46:32.085Z",
"duration": "600s",
"errorCode": "INVALID_VALUE",
"userName": "enterprises/LC04k33pjm/users/114476752020549114690"
},
"done": true,
"error": {
"code": 3
}
}
I'm uncertain which invalid value I inputted into the parameters. Moreover, the LOCK or REBOOT command works correctly without errors for the same device.
The policy associated with this device.
[REQUEST]
GET https://androidmanagement.googleapis.com/v1/enterprises/LC04k33pjm/policies/8f600ee4-0970-4d69-b916-... HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
[RESPONSE]
HTTP/1.1 200
cache-control: private
content-encoding: gzip
content-length: 118
content-type: application/json; charset=UTF-8
date: Tue, 07 May 2024 16:14:04 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"name": "enterprises/LC04k33pjm/policies/8f600ee4-0970-4d69-b916-e4d718e25b8e",
"version": "22"
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 03:57 AM - edited 05-08-2024 04:01 AM
Take a look into the documentation:
Flags that can be used for the RESET_PASSWORD command type.
RESET_PASSWORD_FLAG_UNSPECIFIED | This value is ignored. |
REQUIRE_ENTRY | Don't allow other admins to change the password again until the user has entered it. |
DO_NOT_ASK_CREDENTIALS_ON_BOOT | Don't ask for user credentials on device boot. |
LOCK_NOW | Lock the device after password reset. |
Also see this (https://developers.google.com/android/management/reference/rest/v1/enterprises.devices/issueCommand)...
newPassword | string For commands of type RESET_PASSWORD, optionally specifies the new password. Note: The new password must be at least 6 characters long if it is numeric in case of Android 14 devices. Else the command will fail with INVALID_VALUE. |
resetPasswordFlags[] | enum (ResetPasswordFlag) For commands of type RESET_PASSWORD, optionally specifies flags. |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 05:43 AM
I have tried using all possible inputs in the resetPasswordFlags
---------- [REQUEST] ----------
POST https://androidmanagement.googleapis.com/v1/enterprises/LC04k33pjm/devices/32931cb718c4bbcf:issueCom... HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json
{
"resetPasswordFlags": [
"REQUIRE_ENTRY",
"DO_NOT_ASK_CREDENTIALS_ON_BOOT",
"LOCK_NOW"
],
"type": "RESET_PASSWORD"
}
---------- [RESPONSE] ----------
HTTP/1.1 200
cache-control: private
content-encoding: gzip
content-length: 335
content-type: application/json; charset=UTF-8
date: Wed, 08 May 2024 11:37:30 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"name": "enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operations/1715168250202",
"metadata": {
"@type": "type.googleapis.com/google.android.devicemanagement.v1.Command",
"type": "RESET_PASSWORD",
"createTime": "2024-05-08T11:37:30.202Z",
"duration": "600s",
"resetPasswordFlags": [
"REQUIRE_ENTRY",
"DO_NOT_ASK_CREDENTIALS_ON_BOOT",
"LOCK_NOW"
],
"userName": "enterprises/LC04k33pjm/users/114476752020549114690"
}
}
---------- [REQUEST] ----------
GET https://androidmanagement.googleapis.com/v1/enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operatio... HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
---------- [RESPONSE] ----------
HTTP/1.1 200
cache-control: private
content-encoding: gzip
content-length: 373
content-type: application/json; charset=UTF-8
date: Wed, 08 May 2024 11:40:37 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"name": "enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operations/1715168250202",
"metadata": {
"@type": "type.googleapis.com/google.android.devicemanagement.v1.Command",
"type": "RESET_PASSWORD",
"createTime": "2024-05-08T11:37:30.202Z",
"duration": "600s",
"resetPasswordFlags": [
"REQUIRE_ENTRY",
"DO_NOT_ASK_CREDENTIALS_ON_BOOT",
"LOCK_NOW"
],
"errorCode": "INVALID_VALUE",
"userName": "enterprises/LC04k33pjm/users/114476752020549114690"
},
"done": true,
"error": {
"code": 3
}
}# Using Flag: REQUIRE_ENTRY
---------- [REQUEST] ----------
POST https://androidmanagement.googleapis.com/v1/enterprises/LC04k33pjm/devices/32931cb718c4bbcf:issueCom... HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json
{
"resetPasswordFlags": [
"REQUIRE_ENTRY"
],
"type": "RESET_PASSWORD"
}
---------- [RESPONSE] ----------
HTTP/1.1 200
cache-control: private
content-encoding: gzip
content-length: 299
content-type: application/json; charset=UTF-8
date: Wed, 08 May 2024 11:47:36 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"name": "enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operations/1715168855729",
"metadata": {
"@type": "type.googleapis.com/google.android.devicemanagement.v1.Command",
"type": "RESET_PASSWORD",
"createTime": "2024-05-08T11:47:35.729Z",
"duration": "600s",
"resetPasswordFlags": [
"REQUIRE_ENTRY"
],
"userName": "enterprises/LC04k33pjm/users/114476752020549114690"
}
}
---------- [REQUEST] ----------
GET https://androidmanagement.googleapis.com/v1/enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operatio... HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
---------- [RESPONSE] ----------
HTTP/1.1 200
cache-control: private
content-encoding: gzip
content-length: 338
content-type: application/json; charset=UTF-8
date: Wed, 08 May 2024 11:48:13 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"name": "enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operations/1715168855729",
"metadata": {
"@type": "type.googleapis.com/google.android.devicemanagement.v1.Command",
"type": "RESET_PASSWORD",
"createTime": "2024-05-08T11:47:35.729Z",
"duration": "600s",
"resetPasswordFlags": [
"REQUIRE_ENTRY"
],
"errorCode": "INVALID_VALUE",
"userName": "enterprises/LC04k33pjm/users/114476752020549114690"
},
"done": true,
"error": {
"code": 3
}
}
---------- [REQUEST] ----------
POST https://androidmanagement.googleapis.com/v1/enterprises/LC04k33pjm/devices/32931cb718c4bbcf:issueCom... HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json
{
"resetPasswordFlags": [
"DO_NOT_ASK_CREDENTIALS_ON_BOOT"
],
"type": "RESET_PASSWORD"
}
---------- [RESPONSE] ----------
HTTP/1.1 200
cache-control: private
content-encoding: gzip
content-length: 313
content-type: application/json; charset=UTF-8
date: Wed, 08 May 2024 11:50:02 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"name": "enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operations/1715169001575",
"metadata": {
"@type": "type.googleapis.com/google.android.devicemanagement.v1.Command",
"type": "RESET_PASSWORD",
"createTime": "2024-05-08T11:50:01.575Z",
"duration": "600s",
"resetPasswordFlags": [
"DO_NOT_ASK_CREDENTIALS_ON_BOOT"
],
"userName": "enterprises/LC04k33pjm/users/114476752020549114690"
}
}
# Using Flag DO_NOT_ASK_CREDENTIALS_ON_BOOT: Operation GET
---------- [REQUEST] ----------
GET https://androidmanagement.googleapis.com/v1/enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operatio... HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
---------- [RESPONSE] ----------
HTTP/1.1 200
cache-control: private
content-encoding: gzip
content-length: 353
content-type: application/json; charset=UTF-8
date: Wed, 08 May 2024 11:51:00 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"name": "enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operations/1715169001575",
"metadata": {
"@type": "type.googleapis.com/google.android.devicemanagement.v1.Command",
"type": "RESET_PASSWORD",
"createTime": "2024-05-08T11:50:01.575Z",
"duration": "600s",
"resetPasswordFlags": [
"DO_NOT_ASK_CREDENTIALS_ON_BOOT"
],
"errorCode": "INVALID_VALUE",
"userName": "enterprises/LC04k33pjm/users/114476752020549114690"
},
"done": true,
"error": {
"code": 3
}
}
---------- [REQUEST] ----------
POST https://androidmanagement.googleapis.com/v1/enterprises/LC04k33pjm/devices/32931cb718c4bbcf:issueCom... HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json
{
"resetPasswordFlags": [
"LOCK_NOW"
],
"type": "RESET_PASSWORD"
}
---------- [RESPONSE] ----------
HTTP/1.1 200
cache-control: private
content-encoding: gzip
content-length: 293
content-type: application/json; charset=UTF-8
date: Wed, 08 May 2024 11:53:09 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"name": "enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operations/1715169189027",
"metadata": {
"@type": "type.googleapis.com/google.android.devicemanagement.v1.Command",
"type": "RESET_PASSWORD",
"createTime": "2024-05-08T11:53:09.027Z",
"duration": "600s",
"resetPasswordFlags": [
"LOCK_NOW"
],
"userName": "enterprises/LC04k33pjm/users/114476752020549114690"
}
}# Using Flag LOCK_NOW: Operation GET
---------- [REQUEST] ----------
GET https://androidmanagement.googleapis.com/v1/enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operatio... HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
---------- [RESPONSE] ----------
HTTP/1.1 200
cache-control: private
content-encoding: gzip
content-length: 334
content-type: application/json; charset=UTF-8
date: Wed, 08 May 2024 11:53:42 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"name": "enterprises/LC04k33pjm/devices/32931cb718c4bbcf/operations/1715169189027",
"metadata": {
"@type": "type.googleapis.com/google.android.devicemanagement.v1.Command",
"type": "RESET_PASSWORD",
"createTime": "2024-05-08T11:53:09.027Z",
"duration": "600s",
"resetPasswordFlags": [
"LOCK_NOW"
],
"userName": "enterprises/LC04k33pjm/users/114476752020549114690"
},
"done": true,
"error": {
"code": 3
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 05:25 AM
@Moombas is right your missing the new password and the correct flag.
- Managed Google Play Android enrollment by intune.microsoft.com in Admin discussions
- Difficulty getting Verizon (our reseller) to enroll us in Android Zero-Touch Portal in Admin discussions
- Why CellularTwoGState not working ? in Admin discussions
- Android 15 - Cannot set default password app in Admin discussions
- Android device management - Unable to enroll: DEVICE_MODE_QUARANTINED in Admin discussions