Sunday, April 10

Create a new user if existing credentials got corrupted.

Steps to Create a new user if existing credentials got corrupted.
-----------------------------------------------------------------

1) Open a Command Prompt and then run “setDomainEnv.sh” or “setDomainEnv.cmd”.
2). Just for Safety Take a Backup of (C:\bea103\user_projects\domains\7001_Domain\security\*DefaultAuthenticatorInit.ldift*) file …because in the Next Command which we are going to run is going to Create a New File “DefaultAuthenticatorInit.ldift”.

3). In the Command Window Move inside your Domain’s Security Directory…And then Run the Following Command:

Example: C:\bea103\user_projects\domains\7001_Domain\security>java weblogic.security.utils.AdminAccount newAdmin newPassword .

Syntax: java weblogic.security.utils.AdminAccount

NOTE:- There is a . (DOT) at the end of the Above command which represents the Current Directory. Here you can see that after this command Executes A new “DefaultAuthenticatorInit.ldift” file will be created in the Current Directory.

IMPORTANT STEP


Step3-A).  Login to Admin Console

Security Realms—> myrealm(Your realm Name)—> Migration(Tab)—> Export (Tab)

Here please provide a Directory location for “Export Directory on Server:” TextBox (Example: C:\UserData)

Click on “Save” button…you will find that in the Directory which you have specified you will get :


DefaultAuthenticator.dat
DefaultCredentialMapper.dat
exportIndex.dat
XACMLAuthorizer.dat
XACMLRoleMapper.dat


Step 4). In the Same command prompt Move inside the admin Server folder inside your domain. And then Just remname the “data” folder to something else ….like “data_OLD” this is a way of taking safe backup….

Example: C:\bea103\user_projects\domains\7001_Domain\servers\AdminServer> rename data data_OLD

Step 5). Now Similarly rename the boot.properties as well to an other File….

Example: C:\bea103\user_projects\domains\7001_Domain\servers\AdminServer\security> rename boot.properties boot.properties_OLD

Step 6). Now start The Admin Server….

While starting it will ask for the UserName and Password to be entered as ..we havenot created any “boot.properties” file at present.

————> At the End Login to Admin Console with the New Useraname and Password—–> Check the Users in Security realms …you will not find any user with name “weblogic” There….


Step 7).  To import other User Data back Please do the following:

Login to Admin Console
Security Realms—> myrealm(Your realm Name)—> Migration(Tab)—> Import (Tab)

Now provide the folder Name where u have all the above files:
DefaultAuthenticator.dat
DefaultCredentialMapper.dat
exportIndex.dat
XACMLAuthorizer.dat
XACMLRoleMapper.dat


Enjoy….



To recover the administrator password in a WebLogic domain: (For WL version 9 and higher)

1. At the command line, change directory to the domain and run the setEnv script to set the PATH and CLASSPATH.
2. cd /security
3. mv DefaultAuthenticatorInit.ldift DefaultAuthenticatorInit.ldift_BKP
4. run java weblogic.security.utils.AdminAccount ./
-above command will Create a new DefaultAuthenticatorInit.ldift


4. cd /servers//data/ldap
5. mv DefaultAuthenticatormyrealmInit.initialized DefaultAuthenticatormyrealmInit.initialized_BKP
6. Restart the Admin Server.
7. Login with new username/password


* To change the old admin user identity, log into the admin console and change the password from console.

No comments:

Post a Comment