Uploaded image for project: 'Mule'
  1. Mule
  2. MULE-16540

AuthorizationCodeState not updated on certain circumstances

    Details

    • Type: Bug
    • Status: Closed
    • Priority: To be reviewed
    • Resolution: Done
    • Affects Version/s: 4.1.1 (EE Only)
    • Fix Version/s: 4.2.0, 4.1.6 (EE Only)
    • Component/s: sdk
    • Security Level: Public
    • Labels:
    • Severity:
      S1
    • Bug Boosted:
      No
    • Defect Source:
      Dev Bug
    • Story Points:
      5
    • Severity Label:
      S1
    • Affects:
      nothing

      Description

      The `AuthorizationCodeState` object of an `@AuthorizationCode` ConnectionProvider is not updated under the certain circumstances:

      • If the auth dance is performed for a second time on a CachedConnectionProvider or a PoolingConnectionProvider
      • If a refreshToken operation is executed over a PoolingConnectionProvider, only the instance that triggered the refresh will be updated. All the other instances in the pool will remain untouched.

      The root cause of the problem is that the `AuthorizationCodeState` implementation is immutable. We should instead change to an approach in which our implementation of AuthorizationCodeState is actually a facade to the underlying `ResourceOwnerOAuthContext`. This would also eliminate the need to invoke `org.mule.runtime.module.extension.internal.runtime.connectivity.oauth.OAuthConnectionProviderWrapper#updateAuthState` in `org.mule.runtime.module.extension.internal.runtime.connectivity.oauth.DefaultExtensionsOAuthManager#refreshToken`.

      The key here is to determine if we can implement some kind of callback mechanism so that the facade can cache the state and only refresh it when a refreshToken or new authorization happens.

        Attachments

          Activity

            People

            • Assignee:
              mariano.gonzalez Mariano Gonzalez
              Reporter:
              mariano.gonzalez Mariano Gonzalez
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: