Hi again, this is the third post related to OPSS User and Role API which basically will show how to simply create a user in the weblogic server authenticator. If you haven’t seen the previous posts please see here Part 1 and Part 2.
Let’s the screenshots speak up by themselves. First thing is to have a look to our weblogic’s security realms;
And Users from our DefaultAuthenticator;
Now, in our ADF application we have created added a new method to be exposed through our POJO DC:
Now we can proceed to create a new user;
Click Save and see the result in the weblogic server;
You can also retrieve this list from your adf application as showed in Part 1;
Now. What happened if we decided to use OID as our authenticator provider? let’s have a look how to create a user in OID following the same approach. We now configure OID as our authenticator provider; add a new OID Authenticator (Please note that I wont be showing how to configure the provider specifics. I will asume you will or have read other posts related to how to do this);
We now need to reorder the list and put out OIDProvider first on the list;
And finally we need to change its flag to SUFFICIENT;
(You might need to do the same for DefaultAuthenticator). Now, we restart the WLS and run our application. We first check the users and make sure its bringing the OID ones. (I have cropped the information since its not my personal environment).
Now, we go again to our create user form and create a new user;
Querying the users we can confirm the new __Test user has been created, this time we queried it directly in the Weblogic console;
And the most important part; what code did we use? This;
No. I did not mistake the picture. It uses the same method, the same piece of code that the previous example and in fact, we did not have to modify a thing in the code. That is how OPSS abstraction is exercised. However, you probably may need to customize your code if you need to apply different rules or logic depending in what is your authProvider. I haven’t had time to test, but there is a open debate on whether this won’t work if you are using a SQLAuthenticator. As soon as I get my hands into it and get some results I will posting an update.