Skip to content

Commit abcbd26

Browse files
committed
update administrator unlock guide
1 parent 644c432 commit abcbd26

File tree

1 file changed

+40
-38
lines changed

1 file changed

+40
-38
lines changed
Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,68 @@
11
= Administrator unlock
2+
:page-keywords: administrator, unlock, password reset, administrator lockout, user lockout, user unlock, password reset, user password reset
3+
:page-description: This guide describes how to resolve administrator access issues, such as unlocking a locked account or resetting its password.
24

3-
Ninja does not provide unlock or password reset operations explicitly.
4-
Normally administrator can do this via GUI.
5-
It may happen that administrator locks out itself from the system, in which case we recommend to reinitialize the object:
5+
This guide describes how to resolve administrator access issues, such as unlocking a locked account or resetting its password.
6+
While the procedure is described for administrator user, it can be used for any user object in midPoint.
67

7-
.Administrator object refresh from the initial object
8-
[source,bash]
9-
----
10-
ninja.sh import --input <midpoint>/doc/config/initial-objects/050-user-administrator.xml --overwrite
11-
----
12-
13-
Now, this is rather a drastic measure - let's modify the existing user instead.
14-
First we need to export it.
8+
Under normal circumstances, an an administrator, you can unlock your account or reset your password via midPoint GUI.
9+
However, if you are locked out of the system and cannot log in to the GUI, you can use Ninja to fix your user object directly in the repository.
1510

1611
[NOTE]
17-
Ninja can be used while midPoint is running.
12+
====
13+
With the exception of H2 database, you can use Ninja to modify user objects while midPoint is running as other databases have dedicated servers.
14+
With an H2 database, you need to stop midPoint before using Ninja to modify user objects.
15+
====
16+
17+
Unlock your administrator account or reset your password:
1818

19-
.Exporting administrator user by OID
19+
. Export the administrator user object (in XML) from the repository. +
20+
In the following code example, we are exporting the administrator user by its OID (object identifier):
21+
22+
+
2023
[source,bash]
2124
----
2225
ninja.sh export --oid 00000000-0000-0000-0000-000000000002 --output admin.xml
2326
----
2427

25-
Alternatively, you can use type option and filter to specify name
26-
(don't forget the `--overwrite` option, if the file already exists):
28+
+
29+
Alternatively, you can use the `type` option, and `filter` to specify the user name:
2730

28-
.Exporting user by name
31+
+
2932
[source,bash]
3033
----
3134
ninja.sh export --type user --filter '% name = "administrator"' --output admin.xml
3235
----
3336

34-
Now is the time to carefully edit the object XML.
35-
If a single object is in the XML (which is our case), you can remove the `<objects>` wrapper element.
36-
This may actually help with code completion if xref:/midpoint/tools/studio/[midPoint Studio] is used.
37-
38-
Typical fixes to shape up the uncooperative user object are:
37+
. Edit the exported XML to fix the problem. +
38+
Typical scenarios are:
3939

40-
* Remove `administrativeStatus` and `effectiveStatus` elements from the top-level `activation`
40+
* Fixing issues related to user disabling by removing the `administrativeStatus` and `effectiveStatus` elements from the top-level `activation`
4141
element (be sure not to modify `activation` under `assignments` inadvertently).
42-
This should fix any problems with disabled user.
43-
* If you forgot the password, change the whole content of the `credentials/password/value` element
44-
to this snippet (must be inside the `value` element):
42+
* Resetting a forgotten password by changing the whole content of the `credentials/password/value` element
43+
to the following snippet, i.e., replacing the `<t:encryptedData>...</t:encryptedData>` element in the `<value>` element with:
44+
4545
+
4646
[source,xml]
4747
----
48-
<t:clearValue>asdf1234</t:clearValue>
48+
<t:clearValue>defineYourNewPasswordHere</t:clearValue>
4949
----
5050

51-
After the fixes, it's time to push the object back into the repository.
52-
Import process can handle both plain object or objects inside `<object>` container.
53-
Use the following command:
51+
+
52+
Note that the password you enter into the `<t:clearValue>` element is not checked for compliance with the password policy requirements.
53+
Make sure you either use a password that meets the policy requirements, or change your password once you log into midPoint.
54+
55+
+
56+
If you are using xref:/midpoint/tools/studio/[midPoint Studio], you may improve code completion by removing the `<objects>` wrapper element.
57+
Note that this is not required, and it is only possible as we are updating a single object, i.e., the administrator user.
58+
59+
. Import the updated user object back into the repository. +
60+
The import process can handle both a plain object or objects inside the `<object>` container.
61+
Use the `--overwrite` option as the file already exists.
5462

55-
.Importing the fixed user object
63+
+
64+
.Importing the updated user object
5665
[source,bash]
5766
----
5867
./bin/ninja.sh import --input admin.xml --overwrite
59-
----
60-
61-
Now you should enjoy easy administrator login.
62-
Of course, this works for any user object, but using the GUI with working administrator is the way to go.
63-
64-
[IMPORTANT]
65-
If you changed the password in this way, don't forget to change it immediately to something more solid.
66-
This will also properly encrypt it in the object representation, as expected.
68+
----

0 commit comments

Comments
 (0)