Glassfish workaround to work with OpenAM - glassfish

The IT dept. in the company where I work uses OpenAM to manage web access over the intranet (SSO solution).
As I'm using Glassfish 4.1, which is a container not supported by OpenAM, is there some workaround that I could use OpenAM, without replacing Glassfish? If so, how can I do it?
Thanks in advance.

When using OpenAM 13.5.0 for example, it is possible to deploy OpenAM to Payara 4.1.2.172 for example with a bit of a compromise.
DISCLAIMER: the following steps allows one to deploy OpenAM to GlassFish/Payara, but this does not mean that this kind of deployment is actually supported by anyone.
So the steps are:
in the WAR file within the WEB-INF/lib/openam-radius-server-13.5.0.jar you'll need to remove the META-INF/INDEX.LIST file
you'll need to edit the WEB-INF/web.xml file and remove both the ws and federationrest servlets and their mappings
to deploy the WAR you'll need to execute this command:
bin/asadmin deploy --name openam --contextroot /openam --property implicitCdiEnabled=false OpenAM-13.5.0.war

It seems that OpenAM cannot be deployed on Payara (Glassfish). Please refer to the blog and the last comment of this issue.
So you may have to use another container, for example, Tomcat.

Related

CAS 5.2.4 cas.properties location

I'm using CAS 5.2.4, deployed on Tomcat 9.0.8, running on Windows 10. I want to connect to LDAP, but I don't know where the cas.properties has to be placed.
I have already placed it in :
C:\etc\cas
C:\etc\cas\config
'tomcat'\cas\etc\cas
'tomcat'\cas\WEB-INF\classes
Ok, the problem was that I changed the property spring.profiles.active, I set it as production, now I change it, again, to standalone.
When the stand alone profile is active CAS search extra configurations in /etc/cas/config in particular the file standalone.properties.
When the production profile is active CAS doen not search more configuration files, except if the spring cloud is configurated.
Are you running 5.2.4 or 5.3.4? Given there is no such thing as 5.3.4, you may want to correct the question.
Also note that tomcat 9 is officially not supported.
Properties by default go to c:\etc\cas\config on Windows, which is the same path as /etc/cas/config on Linux. The initial "/" on windows is translated to be the root drive, which for you might be "c:".

How to reference apache cxf library from apache web server

When I deploy my apache cxf web service using eclipse I have to include the apache cxf library in the Web Deployment Assembly in order for it to work when I deploy it on my production apache web server. This is a problem because it makes the war file very large because the cxf library is included. If I exclude the library the war file is much smaller but the web service does not work when it is deployed on the live server even though the apache cxf library is on the live server.
My assumption is I need some kind of classpath reference so the live server can see the apache cxf installation but I am not familiar with how to do this as I am new to apache.
Thanks, Jesse
Put the cxf jars on folder tomcat/lib.
Ok, this workaround worked for me:
We can set the CXF lib path on the common.loader variable which is in $CATALINA_HOME/conf/catalina.properties file. You can add (after the comma) something like this:
common.loader=....,/path/to/cxf/home/lib/*.jar
I couldn't find a way to set an enviroment variable on tomcat in order to have something like: ${cxf.home}/lib/*.jar. I tried to put -Dcxf.home=$CXF_HOME in several places in catalina.sh but it never picked it up :( - hope someone can help on this later.
Restart tomcat and it will take cxf jars

Getting configuration strings from Weblogic

This question is related to Weblogic 12c.
I have an EAR file that I want to deploy in various environments (dev, QA, pre-prod and prod). However, my application requires a username and a password (to connect to another server) and they're not the same across the four environments. I don't want to package 4 different property files in 4 different EAR files. I want a single generic EAR file. Beside, I don't want to handle the prod password during packaging.
Ideally, I'd like the admin of each environment to provide the appropriate username nad password for the environment. Unlike Tomcat, Jetty or JBoss(?), I think it's not possible for a WebLogic Admin to specify this information in a way that it will become available under the java:comp/env JNDI context.
How can an application obtain some admin-defined configuration strings from Weblogic?
BTW, it's not a username/password for a JDBC connection.
From what I understand, you need to change parameters based on the environment you are using right?
If you would like to override parameterss on the fly you can use WebLogic deployment plan concept.
Did you mean that you need to provide username/password to start-up the application?
If so, you may accomplish that by creating a script with WLST http://docs.oracle.com/cd/E15051_01/wls/docs103/config_scripting/using_WLST.html
As far as I know, the WebLogic way is to
Define your username/password as env-entry in the deployment descriptor
Deploy your application together with the plan.mxl whereas each environment admin maintains his own envrionemnt-specific version of the plan.xml
That way you get them into /comp/env/config
More details here: http://docs.oracle.com/cd/E11035_01/wls100/deployment/config.html
Only drawback known to me: plan.xml will always contain the unencrypted password but as the admin knows the password anyway and this is "his" file on "his" maschine that should be fine.

Implementing a JAAS page to a WAR file on JBOSS AS 7.1.1

I'm very new to web applications. I've been told that JBOSS 7.1.1 has an in-built JAAS system which can be enabled on my JBOSS configuration quite simply. However I'm having trouble trying to get this running, namely most internet searching I went through has just ended up with older versions of JBoss.
Does anyone have a step-by-step guide on how to implement a simple JAAS authentication screen on my WAR file in JBoss 7.1.1? Prefarbly using its h2 database. Thanks :)
Also - my machine has trouble with Eclipse, so I can't use any of Eclipse EE's nifty server running mechanisms.
Finally got it. For those of you in the future:
You need your own standard login/logout pages in jsp/html/whatever. You put that in your web.xml constraints. Then you add an xml file called "Jboss-web" and type in your security domain (the default AS 7 is called 'other'). Then lastly add users and roles using adduser.bat in config folder.

Automatic JDBC Realm configuration

I want to know if it's possible to create JDBC Realm configuration in Glassfish 3.1 without admin console, like creation of a Data Source with the glassfish-resources.xml.
When developers download my GIT repository they don't like to configure Glassfish, it's configured in deployment time.
Best regards
Mounir
I'd create a shell script or batch file which runs the required asadmin commands.
Here you can find a complete example: Creating JDBC Objects Using asadmin
(Btw, DTD of GlassFish Resources Descriptor does not contain any realm-related tag (include create-auth-realm).)