When running javatestclient(client of agent api) as independent java application it is running successfully and bringing the sso token attributes into the application on console.
I want that when I ask for the resource from the browser it should be intercepted by my agent api or the javatestclient.
Please help me out what needs to be done.
What is your web/app server? You need Web/Application server agent to intercept the request.
For e.g if your web server is IIS, you will need IIS webagent to intercept the request.
It is possible to implement it using custom agnet API but that is going to be quite complex as you will need to tightly couple your agent api code with the underlying web/app server architecture.
My Web server is Apache.
I want to know that what configuration needs to be done so that my request for application is intercepted by the custom agent api.
Anyway, to implement custom agent on Apache you will first need to know how to implement custom filter/module on Apache which intercepts all HTTP traffic. For this you will need to refer to Apache documentation.
Once you know how to implement custom Apache filters/module you will then need to refer to the customagnet code (JavaTestClient.java) and invoke Policy server for Authentication/Authorization and IsProtected calls.
To be frank, its not worth going through all this trouble and trying to reinvent the wheel when you have a tried and tested Apache Siteminder web agent which you can install and configure in less then 10 minutes