Java agent and transactional authorization

This topic has 3 replies, 3 voices, and was last updated 1 month, 1 week ago by Jatinder Singh.

  • Author
  • #28475


    I’m trying to force user to reauthenticate when he tries to access to protected resource. I’m using java agent and transactional authorization. I’ve configured the java agent and the resource and policy using AM console. But when I try to access to the protected resource ( I’m redirected to the “CDSSO Redirect URI” ( I was expecting to be redirected to the authentication page as I’ve configured in the policy to ask the user to reauthenticate using MFA. Do you know what would cause the redirection to the configured “CDSSO Redirect URI” ? The problem is that I have no error in the logs (AM and agent) so it’s hard to diagnose…

    Here the debug log of the agent :

    AmFilter.isAccessAllowed: GET
    AmFilterMode for application testauthent is URL_POLICY
    AmFilter processing XSS Detection Task Handler
    AmFilter processing AuthnFragmentRelayTaskHandler
    AmFilter processing AuthnExchangeTaskHandler
    AmFilter processing Notification Task Handler
    AmFilter processing FQDN Task Handler
    AmFilter processing Application Logout Handler
    AmFilter processing NotEnforcedTaskHandler
    NotEnforcedTaskHandler.process: reworked URL
    >2021-03-07 13:20:52:188 CET: http-nio-
    INFO: NotEnforcedRuleHelper.isAuthNRequest: requestURI:; AuthNRedirectURI is /test/sunwCDSSORedirectURI; result is false
    AgentUrlPatternMatcher.match: pattern*/favicon.ico
    NotEnforcedRulePatternMatcher: classic pattern: */favicon.ico url: gave: false
    AgentUrlPatternMatcher.match: pattern*/favicon.ico?*
    NotEnforcedRulePatternMatcher: classic pattern: */favicon.ico?* url: gave: false
    NotEnforcedRuleHelper.isNotEnforced(,, GET) FAILED to find a match
    NotEnforcedTaskHandler: Request URI not found in any lists, so is enforced
    AmFilter processing Property Info Task Handler
    AmFilter processing Internal Monitoring Free Access Handler
    AmFilter processing PostAuthnTaskHandler
    AmFilter processing Authn (formerly CDSSO) Task Handler
    AuthnTaskHandler: Recovered user token is null
    User token validation: token null
    validateJwt: returning FAILED as user token is null/blank
    AuthnTaskHandler: JWT/Session is invalid
    AuthnTaskHandler: session validation failed
    >2021-03-07 13:20:52:188 CET: http-nio-
    INFO: CookieUtils:addCookieToResponse adds amFilterCDSSORequest=reset;path=/;max-age=0;Expires=Sun, 07-Mar-2021 12:20:52 GMT;httponly
    recovered cookie: BookKeepingAuthnCookie 1 entry
        [GET nonce zxWQ5zvolpDDfNYrG8mXW3FDjG8 aud testAuthentAgent txId 425f1ce2-fdef-45a5-a64e-630c07967680/1 expires 2021-03-07 12:22:31.222 GMT (in 99s)]
    Utils:isExcludedUserAgent: User Agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0
    Utils:isExcludedUserAgent: No match found returning false
    >2021-03-07 13:20:52:189 CET: http-nio-
    INFO: CookieUtils:addCookieToResponse adds amFilterCDSSORequest=eNrFkDFvwjAQhf9KlLkmthPHMROotEhIrVS1EjBVlnMBgxNHtgMI1P9eTEc6dOsNJ929e--k75KkgzPpOEm3IfTjLPMGM3VEexkw2mvpvcWY41hk5LWmxai3BhC0vbF6pLvg5DiPahbABzmELXQhc3A1Dk4B6p0NsAFIH5K0Dds6vpo_fcSxUxCn82n5xs4Ha_rZrHldu3nVrpb582w3r-KVHG6emD79SZ9uri1K4aRvWkFZQxRQ1NTQoIJJhmRZACpzrDAXJS8rnJHogFMfDaQkjBDBGaGUxr0yrb8K3WBM8jWZXP6filV6B_s1NOKw-XxfLe250Qu3ePTHlz9SEYqXAuMc1YwJVECNkQCiUEE5k5RXss7z36gIRklV3VH5Bqb8pnw;path=/;max-age=300;Expires=Sun, 07-Mar-2021 12:25:52 GMT;httponly
    Written cookie: BookKeepingAuthnCookie 2 entries
        [GET nonce zxWQ5zvolpDDfNYrG8mXW3FDjG8 aud testAuthentAgent txId 425f1ce2-fdef-45a5-a64e-630c07967680/1 expires 2021-03-07 12:22:31.222 GMT (in 99s)]
        [GET nonce ocijekYef9vg_SXWozfiJrJCswM aud testAuthentAgent txId 9c769003-d559-4ed0-9e1c-4275a278ad33/1 expires 2021-03-07 12:25:52.188 GMT (in 299s)]
    AuthnContext: Custom Login is disabled
    getBestMatch called from
        at org.forgerock.agents.ConditionalUrlEntryHelper.generateUrl(
        at org.forgerock.agents.ConditionalUrlEntryHelper.generateLoginUrl(
    domain: path: test/protected entries 1:
      [ConditionalUrlEntry domain: "" path: <empty> url <empty> params "realm=employee" amper false]
    getBestMatch: MATCH: [ConditionalUrlEntry domain: "" path: <empty> url <empty> params "realm=employee" amper false]
    AuthnContext.getRedirectResult, url =
    AmFilter: now processing: Audit Result Handler
    AmFilter.isAccessAllowed: Status STATUS_REDIRECT redirectURL

    Thank you for your help.

    • This topic was modified 1 month, 2 weeks ago by abarry.
     Jatinder Singh

    From the docs – “Java agents work in CDSSO mode by default, regardless of the DNS domain of the AM servers and the DNS domain of the agents.”

    To understand what really is going on, I would suggest breaking it down as follows:

    1. Is your AM configured to use a 3rd-Level domain cookie? If yes, is different from You will have to configure a 2nd-Level domain cookie if it’s the case.

    2. Enable AM and Agent Debugging for more information in the logs.

    3. Divide and Conquer – I would suggest removing the AuthZ from the process and testing if a simple AuthN against your Tree/Chain works. If yes, then we can dive into AuthZ.

    You can check the following docs for more info:



    Hello Jatinder,

    Thank you for your reply.
    I finally found out that I was misconfiguring the CDSSO Redirect URI. I was using my application context /test/sunwCDSSORedirectURI rather than /agentapp/sunwCDSSORedirectURI. Then configuring the CDSSO Redirect URI in my java agent with /agentapp/sunwCDSSORedirectURI resolved the problem.


     Jatinder Singh

    Great! And yes, the ROOT context has to read agentapp

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

©2021 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?