Custom Authentication Provider in Web logic 12c

If you are using Weblogic Server and you need to create Weblogic custom authentication provider, I must say that you are in correct place. When I was reaching how to implement the OAuth in weblogic, I understood that It’s not possible implement OAuth 2 in weblogic because Weblogic 12c doesn’t provide any support to OAuth 2. So I had to create new custom authentication provider in order to achieve Auth 2 implementation.

Creating a Custom Authentication Provider

There were several ways of implementing custom authentication providers in WebLogic. but after trying a lot of ways, the only way which was successfully worked is maven implementation of Authentication.

As a first step, you need to create a basic maven project. After you created a maven project, edit your pom.xml as follow.

First, add the following dependencies to pom.xml file.

Add following properties to pom.xml

Next, Add following build files to pom.xml

Then next step would be adding a profile for Linux users

Now we have successfully edited the pom.xml file. Our next step is to create CustomAuthentication.xml file inside resource directory.

you need to add commo.dtd file to resource directory. download file from this link.

Now we are going to create SampleAuthenticationProvider class.

Next we are going implement class

Finally, you need to create call to handle user callbacks.

Now we have implemented a fully working authentication provider. If you do maven install, you will be able to see that your custom authentication provider is created in the target file. You need to copy this file to WebLogic mbeantype folder (This, we have done automatically using our pom.xml file).

Mbeantypes location : ../wlserver/server/lib/mbeantypes

Finally, restart the server. Now you can see your created custom authentication provider in the weblogic authentication providers list.

If you like this post, you can read more articles on my personal blog



Software Engineer at Creative Software

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store