Pages

Wednesday, November 28, 2007

ADF security in your project

ADF Security implementation can be viewed as an extension to the standard J2EE container security and is executed after the standard security constraints have been processed. It is integrated in ADF of jdeveloper 11g and is implemented dynamically. This gives us many advantages such as changes in roles are immediately active and you can have different permissions in one page. For example in the pagedef you can add rights to roles on specific attributes, pages and methods. In your applications, you can also use Expression Language (EL) to show or hide items on a page based on a user's permissions, which are defined in the run time policy store.

If you use adf security in your application and you also selected anonymous access in the adf wizard then you automatically are logged in as anonymous if this page does not have security and if you go to a page where there is no anonymous security defined then you get a login window or you can start the following url /project-context/adfAuthentication to get the login windows.

Here you define in the pagedef of the page that to see the page you have to have the view permission.

If you run the adf security wizard then the following files are created or changed

workspace_home/.adf/META-INF/adf-config.xml

element sec:JaasSecurityContext added




workspace_home/.adf/META-INF/credential-jazn-data.xml

anonymous login account




workspace_home\src\META-INF\orion-application.xml
workspace_home\src\META-INF\jps-config.xml
workspace_home\src\META-INF\jazn-data.xml

and of course the web.xml


If you start the adf security wizard yourself then select no identity store by step 4. Then you use the jazn of the embedded oc4j, the other options gives jazn errors


Make sure if you run on windows xp that you start jdeveloper in single user mode ( jdeveloper -singleuser) else the jazn editor in the embedded oc4j does nothing.

In the next adf security blog I will demostrate the different security options in a page.

JDeveloper 11g single user mode

I discovered that the jazn configuration (Identity Store) in 11g tp2 of the embedded oc4j didn't work, so I googled a bit and saw the solution of Steve Muench. It seems that jdeveloper 11g is started by default in multiuser mode. That's why it creates a jdeveloper directory with the embedded oc4j in your user folder. The jazn error is caused by a space in the folder name of the user. On windows xp you have your user data in this folder C:\Documents and Settings\ebi15170. You can solve this by starting jdeveloper with the -singleuser option or set the JDEV_USER_DIR environment variable to a folder name with no spaces.

Steve Muench hold a jdeveloper 11g page with more tip so check this out.

Sunday, November 25, 2007

http analyzer to test and monitor ws

The http analyzer is not new in jdeveloper but in 11g Oracle added some new features. You can define now rules in the http analyzer. With these rules you can emulate ws and change your environment. The following rules are supported Tape, URL Substitution, Pass Through and Forward, I will explain these rules later in this blog. You can save and load the web services requests and responses in a ws-i log file, test a web service in the http analyzer in the same way as in the oc4j server and it supports https.

The display of a ws call with his return message is better and this display can also be used to test other web services like you can in the 10.1.3 oc4j container


The http analyzer support rules ,this means that one of the rules has to fire else the calling ws client gets a error. You can put in many rules and the http analyzer tests the rules from the first to the last. If the rulefilter matches then the analyzer does the action and waits for the next ws request

The first rule is forward. Forward does the same as in 10.1.3 , it passes the message on to the real web service.

In the url filter you can set the incoming url of the web service and in the target url you can set the real url of the web service. Filter tester is to test the url filter with the calling url. This can be handy because in the url filter you can define wildcards.
With the tape rule you can test the ws client without the need of the webservice. first you have to save the entries in a ws-i log file then you can use this file to respond to the ws client calls.


The url filter and filter tester are the same as forward rule. The tape path is the ws-i log file of the saved entries. The tape rule can correct the time and size of the entries in the ws-i log file so the returning message to the ws client is valid. Loop tape is necessary if you want to retry the ws client.

The last two rules are url substitution pass through rule. The first you can use if you want to change the url or parts of this url because you deployed it to an oc4j container in stead of the embedded oc4j of jdeveloper.

the pass through rule does nothing if it matches the url filter.

Conclusion, you can use the analyzer perfectly for your test environment because with the tape rule you don't need all the web services to test your ws client and if there is a change in your ws environment you can use the other rules to fix it or let is pass.