|
1 | 1 | = 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. |
2 | 4 |
|
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. |
6 | 7 |
|
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. |
15 | 10 |
|
16 | 11 | [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: |
18 | 18 |
|
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 | ++ |
20 | 23 | [source,bash] |
21 | 24 | ---- |
22 | 25 | ninja.sh export --oid 00000000-0000-0000-0000-000000000002 --output admin.xml |
23 | 26 | ---- |
24 | 27 |
|
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: |
27 | 30 |
|
28 | | -.Exporting user by name |
| 31 | ++ |
29 | 32 | [source,bash] |
30 | 33 | ---- |
31 | 34 | ninja.sh export --type user --filter '% name = "administrator"' --output admin.xml |
32 | 35 | ---- |
33 | 36 |
|
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: |
39 | 39 |
|
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` |
41 | 41 | 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 | +
|
45 | 45 | + |
46 | 46 | [source,xml] |
47 | 47 | ---- |
48 | | -<t:clearValue>asdf1234</t:clearValue> |
| 48 | +<t:clearValue>defineYourNewPasswordHere</t:clearValue> |
49 | 49 | ---- |
50 | 50 |
|
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. |
54 | 62 |
|
55 | | -.Importing the fixed user object |
| 63 | ++ |
| 64 | +.Importing the updated user object |
56 | 65 | [source,bash] |
57 | 66 | ---- |
58 | 67 | ./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