How is your experience with the OutSystems Community?
15
Views
6
Comments
First Login After Logout Redirects to _error.html

Scenario:

We are creating applications in OutSystems Developer Cloud (ODC). We use Entra ID Authentication for all our apps. We maintain a centralized authentication application(Authenticator ). Consumer application use the login and logout actions created inside this app. (Login_Testing) is the name of the consumer app used for this scenario. 

When user logout out of a consumer application(Login_Testing ) we send the bookmarkable URL of the application to the logout action inside Authenticator app. 

https://<environment> /Login_Testing in this scenario

Issue Description:

Logout works successfully. However, when a user attempts the first login of the day or logs in immediately after logout, the user is redirected to: 

https://<environment>/Authenticator/_error.html

Error Observed:

Screen not found: /Login_Testing/ - Later, after implementing logging and exception handling, we identified the actual platform error:  OS-CLRT-40102 2 Error performing authentication action because a user is already authenticated via a different mechanism. To proceed, a logout is necessary.

Logging & Diagnostics 

  • Added exception handling in login/logout URL generation actions. 
  • Added flow-level exception handling. 
  • Added application logging to capture authentication failures. 

Authentication Flow Changes 

  • Implemented fallback generation of external login URLs. 
  • Tried invoking ODC Logout action. 
  • Implemented a custom Login → Logout → Login retry flow when OS-CLRT-40102 occurs. 
  • Added server action to preserve ReturnToURL during redirects. 
  • Updated Login screen logic to handle success/failure branches differently. 

Current Result:

Despite all the above changes,  Authentication still hits OS-CLRT-40102. User is eventually redirected to https://<environment> /Authenticator/_error.html. instead of successfully re-authenticating.

Questions:

  • Has anyone encountered OS-CLRT-40102 in an ODC + Entra ID setup with a centralized SSO application?
  • Is there an officially recommended way to completely clear conflicting ODC authentication sessions before invoking GetExternalLoginURL?
  • Are there known issues with GetExternalLogoutURL not fully clearing session state in certain scenarios? 
  • What is the recommended login/logout sequence for ODC applications using a shared authentication broker application? 
  • Is there any additional logging, monitoring, or platform-level configuration that could help identify why the user is still landing on _error.html after the logout-login recovery flow?

Any guidance or best practices would be greatly appreciated.


Thanks,

Gowtham Shanmugam

2023-12-26 10-35-28
OutSystems Neo
Staff
AI Generated

You’re hitting a conflict between ODC’s internal authentication state and the external Entra ID flow, and the centralized “Authenticator” app is making that more visible.

Below is how I’d look at it and what you can do, based on how ODC authentication and external IdPs are expected to work.


1. About OS-CLRT-40102 in ODC + Entra ID

The error:

OS-CLRT-40102 – Error performing authentication action because a user is already authenticated via a different mechanism. To proceed, a logout is necessary.

means:

  • ODC thinks there is already an authenticated user in the browser context,
  • but the current authentication flow (GetExternalLoginURL / Entra ID) doesn’t match the existing mechanism/session,
  • so the platform blocks the new authentication attempt and requires a full logout first.

In a classic (per‑app) scenario, this usually happens if you mix default ODC login with external login, or if you try to re‑authenticate while a valid session is still active. In your case, the centralized Authenticator app and shared flows make this easier to trigger.


2. Centralized SSO app in ODC – key constraints

In ODC, each app still has:

  • its own session and internal authentication state;
  • platform‑provided GetExternalLoginURL and GetExternalLogoutURL that handle the “right way” to start/finish external auth for that app.

When you centralize login/logout in an Authenticator app, you must ensure that:

  1. The logout actually terminates the ODC session for the consumer app and the Authenticator app.
  2. You never call GetExternalLoginURL for an app while that app still has a valid authenticated user.
  3. Your use of ReturnToURL does not reintroduce an already-authenticated app in the middle of the flow.

If a browser keeps an authenticated session to Login_Testing while you start a fresh external login from Authenticator, you can easily get OS-CLRT-40102.


Even if you use a broker app, the basic pattern should be:

Logout sequence

From consumer app (Login_Testing):

  1. Call GetExternalLogoutURL() for that app.
  2. Redirect the user to the returned URL.
  3. IdP (Entra ID) performs logout, then returns to your configured logout return URL.
  4. At the logout return URL, ensure:
    • The app session is cleared (no authenticated user).
    • You decide where to send the user next (e.g. Authenticator’s login or a landing page).
  5. If you redirect to Authenticator at the end of logout, make sure Authenticator itself does not still have a valid session (i.e., it should also be treated as an app that needs logout).

If you must coordinate multiple apps, see the classical unified login/logout approach for inspiration: a “hub” page that becomes the redirect destination and then sends the user to the right app based on roles and availability, instead of relying on Client.LastURL/ReturnToURL only. Use the same login for multiple apps

Login sequence

From Authenticator (broker):

  1. Ensure no active authenticated user exists for Authenticator when starting login.
  2. Call GetExternalLoginURL() with the appropriate ReturnToURL (e.g., https://<environment>/Login_Testing/...).
  3. Redirect the user to the URL returned by GetExternalLoginURL.
  4. IdP authenticates and returns to ODC.
  5. ODC completes login and redirects to the ReturnToURL.
  6. The consumer app (Login_Testing) receives the user in an authenticated state and navigates to its initial screen.

The critical part is: don’t start step 2 while an existing internal session is still active – otherwise OS-CLRT-40102 is expected.


4. Why you still see _error.html after your retry flow

Your “Login → Logout → Login retry” flow is exactly what the platform is asking for, but the error indicates that the logout is not fully clearing the conflicting context. Common causes:

  • Logout is only executed in Authenticator, while the consumer app (Login_Testing) still has a valid session.
  • GetExternalLogoutURL is called from one app, but another app remains authenticated and participates in the redirect chain via ReturnToURL.
  • The browser has multiple tabs/windows open with different ODC apps, and one of them keeps a conflicting session active.
  • Your “preserve ReturnToURL” logic re-introduces a URL for an app that is still authenticated in that browser, causing the next login attempt to hit a half‑logged‑out state.

In short: the entire browser context must be transitioned to “logged out” for all participating ODC apps before a fresh external login is initiated.


5. Is there a way to “force clear” ODC authentication sessions before GetExternalLoginURL?

Within an ODC app, the supported way to fully clear authentication is:

  • Use the platform‑provided logout (GetExternalLogoutURL + redirect) so ODC can clean its server‑side state and cookies consistently.

There isn’t an extra “manual purge all sessions” API beyond that; if you manually try to mix custom logout logic with platform-managed sessions, you often end up in the state that triggers OS‑CLRT‑40102.

So, the safest pattern is:

  1. From every app involved (Authenticator and the consumer), always perform platform logout using GetExternalLogoutURL.
  2. Only after the browser has completed the logout redirect chain and is back in a non‑authenticated context, call GetExternalLoginURL.

If you’re attempting to call GetExternalLoginURL from inside an error handling flow that still belongs to an authenticated request, ODC can still see the current user as logged in and throw OS‑CLRT‑40102.


6. Known issues / behavior with centralized SSO and Return URLs

From the classic platform world (non‑ODC), similar behavior has been seen:

  • Referrer/Return URL stored in session gets lost or is inconsistent when logout/login redirections span across multiple apps or when the browser idles between redirects. Return URL from Azure AD login not working

Typical mitigations there (many of which also apply conceptually in ODC):

  • Use a single “landing” page (in your Authenticator or theme) as the final redirect. This page:
    • Checks the current authenticated user,
    • Evaluates roles / permissions,
    • Explicitly navigates the user to the correct consumer app (instead of relying solely on ReturnToURL stored in session).
  • Avoid chaining too many redirects through different apps with session-based ReturnToURL values that may be cleared when the session is closed.

Your centralized Authenticator is already similar to this; you may want to:

  • Make _error.html redirect to a “safe landing” screen instead of just failing.
  • On that landing screen, check:
    • If user is still authenticated in any context; if yes, decide whether you must log out again or just navigate.
    • If user is not authenticated, start a fresh GetExternalLoginURL from a clean context.

7. Additional logging / monitoring

Given that you already have application logging and exception handling:

  • Log current authentication mechanism and whether the request is considered authenticated at the start of any login/logout action.
  • Log:
    • The URL returned by GetExternalLoginURL and GetExternalLogoutURL.
    • The exact path and query parameters when _error.html is hit.
  • Correlate logs between Authenticator and Login_Testing in the same time window to see:
    • Whether logout from Login_Testing truly occurs before Authenticator starts login.
    • Whether there are overlapping requests from different tabs.

On environments where you have access to platform logs, look specifically at:

  • Authentication-related events around the time of OS-CLRT-40102,
  • Any warnings about mixed mechanisms or invalid session states.

If, after aligning your flow with the patterns above, you still consistently hit OS‑CLRT‑40102, then it’s likely a platform-level behavior or edge case, and raising it to OutSystems Support with your exact redirect sequence is warranted.


8. Concrete best‑practice checklist for your setup

For your centralized Authenticator + Entra ID in ODC:

  1. Per-app logout

    • Always call GetExternalLogoutURL() from the app you are logging out (Login_Testing, Authenticator, etc.).
    • Do not rely solely on “global” logout inside Authenticator; ensure each app that participates in SSO runs its own platform logout when you intend to fully clear the browser.
  2. Safe landing instead of direct ReturnToURL

    • Configure your final logout return URL to point to an Authenticator “Hub” screen.
    • That Hub screen:
      • Confirms the user is unauthenticated,
      • Starts a fresh login when needed,
      • Routes to the correct consumer app.
  3. No login while authenticated

    • Before invoking GetExternalLoginURL in Authenticator, add a guard:
      • If Authenticator itself has an authenticated user, perform logout first (GetExternalLogoutURL + redirect).
      • Only when the request is unauthenticated, call GetExternalLoginURL.
  4. Handle _error.html as recovery, not dead-end

    • Change _error.html behavior to:
      • Log the error,
      • Redirect to the Hub screen that applies the rules above,
      • From there, either log out again (if session still looks inconsistent) or start a clean login.
  5. Minimize chained redirects with session-based ReturnToURL

    • Prefer a deterministic Hub screen to decide “where to go next” based on user roles and app availability, similar to the suggested theme homepage pattern in unified login scenarios. Use the same login for multiple apps

If you want, you can describe your current exact sequence (who calls GetExternalLogoutURL / GetExternalLoginURL, and what each ReturnToURL is), and I can help you re‑shape it into a minimal, conflict‑free flow that matches the checklist above.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
2023-10-30 06-03-17
Gowtham
1. User tries to access Login_Testing app 2. Login_Testing redirects to Authenticator to handle login 3. It passes its own screen path as the ReturnToURL (i.e. where to send the user back after login) 4. GetLoginURL builds: https://.../Authenticator/Login?ReturnToURL= 5. The Login screen's OnReady calls GetDefaultExternalLogjnURL to get the identity provider's login URL 6. Something fails, the exception handler catches it and falls back to ReturnToURL 7. But ReturnToURL at this point is the Login_Testing app URL, not the identity provider URL 8. The platform tries to resolve /Login_Testing/ as a screen within Authenticator — it's not there — so it shows the error page "https:///Authenticator/_error.html"
2023-12-26 10-35-28
OutSystems Neo
Staff
AI Generated

You’re running into a mismatch between ODC’s own authentication session and the Entra ID flow, and the fact you’re centralizing everything in an Authenticator app makes OS‑CLRT‑40102 much easier to hit.

Below I’ll focus on the practical side: how to structure the flow in ODC, and what you can still try given the restrictions of the platform.


1. What OS‑CLRT‑40102 is telling you in ODC

The message:

Error performing authentication action because a user is already authenticated via a different mechanism. To proceed, a logout is necessary.

In ODC this typically means:

  • There is an authenticated ODC session associated with the current browser context.
  • You’re trying to start another authentication flow (via GetExternalLoginURL / Entra ID) that doesn’t match the current session or is being started from an already-authenticated request.
  • ODC refuses to proceed until a proper logout runs.

In a centralized SSO setup, this usually happens when:

  • The Authenticator app starts an external login while it still has a valid ODC session.
  • Or the consumer app that you’re redirecting to (Login_Testing) is still authenticated in the browser while the Authenticator is trying to initiate a new login.

2. Centralized Authenticator in ODC – important constraints

Even in ODC:

  • Each application has its own session and authentication state.
  • The platform expects you to start and end external auth per app via the built‑in actions (GetExternalLoginURL, GetExternalLogoutURL).

When you build a broker app (Authenticator) you are effectively:

  • Calling these actions on behalf of other apps.
  • Redirecting through multiple apps while ODC is trying to manage sessions per app.

This increases the chance that:

  • One app thinks the user is authenticated,
  • Another app tries to kick off a new login,
  • ODC sees that conflict and triggers OS‑CLRT‑40102.

So the key is: make sure that no app involved in the flow is still authenticated when you call GetExternalLoginURL for a fresh login.


Let’s rewrite your sequence in a way that minimizes conflicts.

Logout from consumer app (Login_Testing)

When user clicks “Logout” in Login_Testing:

  1. In Login_Testing, call GetExternalLogoutURL() (the ODC‑provided action for that app).
  2. Redirect the user to the returned URL.
  3. Entra ID performs logout, then redirects to your configured logout return URL.
  4. That logout return URL should:
    • Land either in Login_Testing or in Authenticator,
    • Immediately treat the request as non‑authenticated and not start login yet.
  5. Only after the logout redirect chain is completely finished, navigate the user to the “central” Authenticator login screen (if that’s your UX).

Key point: The logout should be initiated by the app whose session you want to clear, not only by the Authenticator app.

Login from Authenticator

On the Authenticator login screen:

  1. First check if Authenticator itself is authenticated:
    • If yes, perform an ODC logout for Authenticator (call GetExternalLogoutURL() in Authenticator and redirect),
    • Wait for that logout to complete and return to an unauthenticated context.
  2. Once Authenticator is confirmed unauthenticated:
    • Call GetExternalLoginURL() with ReturnToURL = "https://<environment>/Login_Testing/...".
    • Redirect to the URL returned by GetExternalLoginURL.
  3. Entra ID completes login and ODC will redirect to the ReturnToURL (Login_Testing).
  4. Login_Testing receives an authenticated user and routes to its entry screen.

The critical rule: Never call GetExternalLoginURL from an authenticated request (in any app that participates in the flow).


4. Why your current retry flow still ends up at _error.html

Your custom “Login → Logout → Login retry” logic is conceptually correct, but OS‑CLRT‑40102 means logout is not happening from the perspective of the platform:

Typical pitfalls:

  • Logout only in Authenticator
    Login_Testing’s session persists, so when you re‑enter Login_Testing via ReturnToURL, ODC sees a valid session and treats the attempt to start a new external login as conflicting.

  • ReturnToURL re‑introduces an authenticated app
    If you preserve and reuse a ReturnToURL that points to a screen in Login_Testing while Login_Testing is still authenticated, the “next login” attempt is not really clean.

  • Multiple tabs/windows
    Another tab with Login_Testing or another ODC app can keep a session, and any cross‑app redirect chain can then hit OS‑CLRT‑40102 when you restart login from Authenticator.

  • Starting login inside error handling
    If your OS‑CLRT‑40102 handling is executed in the same request that is still treated as authenticated, calling GetExternalLoginURL there will again see a conflicting session.


5. Clearing conflicting ODC sessions – what is and isn’t possible

In ODC, you don’t have a “force purge all sessions” API.

You have:

  • The platform’s logout actions (GetExternalLogoutURL followed by redirect), which:
    • Clear server-side session state for the app,
    • Reset cookies/tokens appropriately for that app.

To fully clear conflicts in a centralized SSO scenario, you need to:

  1. Ensure each app (Authenticator and all consumer apps) uses GetExternalLogoutURL when you want its session gone.
  2. Avoid calling GetExternalLoginURL in any app while that app is authenticated.
  3. Avoid combining this with custom cookie logic or manual session hacks – those can put the platform in an undefined state that leads to OS‑CLRT‑40102.

6. Handling _error.html as a recovery point

Right now _error.html is a dead end. You can turn it into a recovery step:

  • On _error.html, instead of only showing the error:

    1. Log the error and capture:
      • Current URL,
      • Any query parameters,
      • Whether the request is authenticated (using your server-side logic).
    2. Immediately redirect to a “hub” screen in Authenticator, e.g. /Authenticator/AuthHub.
  • On AuthHub:

    1. Check if the current request is authenticated in Authenticator.
      • If yes, perform GetExternalLogoutURL in Authenticator and redirect.
      • After redirect back to AuthHub (now unauthenticated), proceed.
    2. Only when Authenticator sees the user as unauthenticated:
      • Start a clean login:
        • Call GetExternalLoginURL(ReturnToURL = OriginalTargetAppURL)
        • Redirect to the returned URL.

This way, any error or inconsistent state is funneled into a deterministic hub screen that always forces a logout first, then a fresh login.

Conceptually this is similar to the “unified login” app approach that OutSystems recommends for multiple apps with shared authentication. Use the same login for multiple apps


7. What you can still log to understand the conflict

You already added logging and exception handling, which is great. Given OS‑CLRT‑40102 is about existing sessions, I’d add:

  • Before any call to GetExternalLoginURL or GetExternalLogoutURL:

    • Log:
      • App name (Authenticator vs Login_Testing),
      • Whether your logic considers the user authenticated,
      • The URL you’re about to use as ReturnToURL.
  • On _error.html:

    • Log:
      • The full path (/Authenticator/_error.html),
      • Any query string parameters,
      • Whether your logic sees a current user/session.
  • Compare logs between Authenticator and Login_Testing:

    • For the same user and timestamp, verify:
      • Did Login_Testing logout complete before Authenticator started a new login?
      • Were there any requests where Authenticator called GetExternalLoginURL while your logs say “user is authenticated”?

If after you align the flow as above you still consistently see OS‑CLRT‑40102, that strongly suggests a platform-level edge case, and at that point it’s worth opening a Support case with the exact redirect sequence and your logs.


8. Direct answers to your specific questions

Has anyone encountered OS‑CLRT‑40102 in an ODC + Entra ID setup with a centralized SSO application?

Yes, it’s a typical symptom in setups where:

  • A central app starts external login,
  • But one of the other apps in the browser context is still authenticated, or
  • Login is triggered from an authenticated request.

Is there an officially recommended way to completely clear conflicting ODC authentication sessions before invoking GetExternalLoginURL?

Within one app: use only the platform logout (GetExternalLogoutURL + redirect), then start login from an unauthenticated request.
Across several apps: you need to ensure each participating app uses platform logout before starting a fresh centralized login flow. There’s no global “kill all sessions” API.

Are there known issues with GetExternalLogoutURL not fully clearing session state in certain scenarios?

The typical issues are not that GetExternalLogoutURL fails, but that:

  • It’s called from only one app while others remain authenticated,
  • Or custom logic (manual cookies, extra redirects) interferes with the platform’s expected flow.

What is the recommended login/logout sequence for ODC apps using a shared authentication broker application?

In short:

  1. Logout:
    • Always from the app being logged out (consumer app first).
    • Broker app (Authenticator) also logs out if it has its own session.
  2. Only after all relevant apps are logged out:
    • Broker app, from an unauthenticated request, calls GetExternalLoginURL and uses ReturnToURL to send the user to the consumer app.

Any additional logging/monitoring or configuration to see why the user lands on _error.html after the recovery flow?

  • Instrument _error.html and your Authenticator hub screen heavily:
    • Log auth status, app, ReturnToURL, and the sequence of redirects.
  • Correlate those with your logout and login attempts.
  • If the pattern shows “login called from an authenticated request” even once, that’s the likely trigger for OS‑CLRT‑40102.

If you’re able to outline your exact redirect chain (who calls which action, with which ReturnToURL, in order), I can help you reshape it into a minimal sequence that avoids the conflicting state and OS‑CLRT‑40102.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
2023-10-30 06-03-17
Gowtham
Below are the steps 1. User tries to access Login_Testing app 2. Login_Testing redirects to Authenticator to handle login 3. It passes its own screen path as the ReturnToURL (i.e. where to send the user back after login) 4. GetLoginURL builds: https://.../Authenticator/Login?ReturnToURL= 5. The Login screen's OnReady calls GetDefaultExternalLogjnURL to get the identity provider's login URL 6. Something fails, the exception handler catches it and falls back to ReturnToURL 7. But ReturnToURL at this point is the Login_Testing app URL, not the identity provider URL 8. The platform tries to resolve /Login_Testing/ as a screen within Authenticator — it's not there — so it shows the error page "https:///Authenticator/_error.html"
2023-12-26 10-35-28
OutSystems Neo
Staff
AI Generated

You’ve essentially debugged the root cause already: in your Authenticator app, the fallback path in the login exception handler is using the app ReturnToURL (Login_Testing) instead of an IdP URL, and because that URL is not a screen of Authenticator, ODC sends you to Authenticator/_error.html.

Let me break it down and then suggest a concrete fix for your flow.


What’s happening step‑by‑step

Your sequence:

  1. User opens Login_Testing.
  2. Login_Testing redirects to Authenticator (central login broker).
  3. Login_Testing passes its own screen path as ReturnToURL (e.g. https://<env>/Login_Testing/...).
  4. Authenticator builds something like:
    https://<env>/Authenticator/Login?ReturnToURL=<encoded Login_Testing URL>.
  5. Authenticator’s Login screen OnReady calls GetDefaultExternalLoginURL (ODC’s action that returns the Entra ID login URL).
  6. GetDefaultExternalLoginURL fails (network / config / session conflict, etc.).
  7. Your exception handler falls back to ReturnToURL.
    • At this point, ReturnToURL = Login_Testing URL, not the IdP URL.
  8. The platform sees that you’re still in the Authenticator app, and you’re trying to navigate to a relative path /Login_Testing/ that doesn’t exist as a screen in Authenticator, so ODC displays Authenticator/_error.html.

This fallback behavior is very similar to what happens in classic OnException flows when people redirect to the wrong place and land in a loop or in another app’s login instead of their own. Remove login screen


How to fix the flow

You need to separate clearly:

  • IdP URL (from GetDefaultExternalLoginURL)
  • App ReturnToURL (Login_Testing URL)

…and never use ReturnToURL as a fallback when IdP login fails.

1. Change the exception handling on Authenticator/Login

On the Authenticator login screen’s OnReady:

Current (problematic) pattern (simplified):

Try
    IdpUrl = GetDefaultExternalLoginURL()
    RedirectToURL(IdpUrl)
Catch
    // Fallback
    RedirectToURL(ReturnToURL)
End

Recommended pattern:

  • Treat IdP failures as authentication errors, not “go back to target app”.
Try
    IdpUrl = GetDefaultExternalLoginURL()
    RedirectToURL(IdpUrl)
Catch SecurityException or AuthenticationException
    // 1. Log details
    // 2. Redirect to a dedicated error / recovery screen in Authenticator
    RedirectToURL(GetEntryURL(AuthErrorScreen))
Catch AllOtherExceptions
    // Same: log + error screen, NOT ReturnToURL
    RedirectToURL(GetEntryURL(AuthErrorScreen))
End

On AuthErrorScreen (in Authenticator):

  • Show a message like: “SSO authentication failed. Please try again or contact support.”
  • Optionally expose a “Retry Login” button that:
    • Calls GetDefaultExternalLoginURL again from a clean, unauthenticated context;
    • Or, if needed, first calls GetExternalLogoutURL for Authenticator, then restarts the login flow.

This is conceptually the same advice given for SSO exceptions in the classic platform: you send the user to a dedicated error screen, not back to the original page, to avoid loops and confusion. Remove login screen

2. Preserve ReturnToURL separately

You still need ReturnToURL (= Login_Testing URL) to know where to send the user after IdP login succeeds, but it should not be used when IdP login fails.

Pattern:

  • Maintain a client variable or input parameter for ReturnToURL in Authenticator.
  • Use it only:
    • When building the GetExternalLoginURL request that will be sent to the IdP.
    • When redirecting the user after successful authentication.

Do not use ReturnToURL in:

  • Exception handlers for GetDefaultExternalLoginURL,
  • Internal error flows in Authenticator (OnException, error.html, etc.).

Using a dedicated client variable to store the post-login URL is similar to how OutSystems templates handle post-login navigation in reactive apps (store target URL in client state and use it after login). Redirect to correct link from Email after login


Relation to OS‑CLRT‑40102

In your broader scenario, OS‑CLRT‑40102:

“Error performing authentication action because a user is already authenticated via a different mechanism. To proceed, a logout is necessary.”

is about conflicting session state when starting a new external login. Fixing your exception handling won’t by itself clear sessions, but it will:

  • Stop sending users to invalid URLs (like treating ReturnToURL as if it were an IdP URL),
  • Prevent _error.html from being the default “fallback”, and instead funnel errors to a recoverable screen.

Combined with a careful login/logout sequence (per app, as discussed before), this should significantly reduce the inconsistent states that cause both OS‑CLRT‑40102 and _error.html redirects.


Practical summary for your Authenticator app

  1. OnReady of Login screen:

    • Call GetDefaultExternalLoginURL.
    • On success: redirect to IdP URL.
    • On failure: redirect to AuthErrorScreen; don’t use ReturnToURL.
  2. AuthErrorScreen (Authenticator):

    • Show error, log details.
    • Optional: “Retry” that:
      • Ensures Authenticator is logged out if necessary (GetExternalLogoutURL),
      • Calls GetDefaultExternalLoginURL again from a clean context.
  3. ReturnToURL handling:

    • Only used to:
      • Build the external login URL (GetExternalLoginURL(ReturnToURL = Login_Testing URL)),
      • Redirect after successful login.
    • Never used as a fallback navigation for failed IdP calls.

If you adjust the exception handling like this, the platform won’t try to resolve /Login_Testing/ as a screen in Authenticator, and your users should stop landing in Authenticator/_error.html for this specific case.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.