diff --git a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/explorerActions/SignInToQAction.kt b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/explorerActions/SignInToQAction.kt index 6cfc58573a..1778e66889 100644 --- a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/explorerActions/SignInToQAction.kt +++ b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/explorerActions/SignInToQAction.kt @@ -8,6 +8,7 @@ import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.application.runInEdt import com.intellij.openapi.project.DumbAwareAction import com.intellij.openapi.wm.ToolWindowManager +import software.aws.toolkits.jetbrains.core.credentials.ReauthSource import software.aws.toolkits.jetbrains.core.credentials.ToolkitConnectionManager import software.aws.toolkits.jetbrains.core.credentials.pinning.QConnection import software.aws.toolkits.jetbrains.core.credentials.reauthConnectionIfNeeded @@ -39,7 +40,7 @@ abstract class SignInToQActionBase(actionName: String) : DumbAwareAction(actionN UiTelemetry.click(project, "auth_start_Q") val connectionManager = ToolkitConnectionManager.getInstance(project) connectionManager.activeConnectionForFeature(QConnection.getInstance())?.let { - reauthConnectionIfNeeded(project, it, isReAuth = true) + reauthConnectionIfNeeded(project, it, isReAuth = true, reauthSource = ReauthSource.CODEWHISPERER_STATUSBAR) } ?: run { runInEdt { if (requestCredentialsForQ(project, isReauth = false)) { diff --git a/plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/util/CodeWhispererUtil.kt b/plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/util/CodeWhispererUtil.kt index deffcb7e6f..a9c2a212c6 100644 --- a/plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/util/CodeWhispererUtil.kt +++ b/plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/util/CodeWhispererUtil.kt @@ -26,6 +26,7 @@ import software.aws.toolkits.core.utils.getLogger import software.aws.toolkits.core.utils.warn import software.aws.toolkits.jetbrains.core.credentials.AwsBearerTokenConnection import software.aws.toolkits.jetbrains.core.credentials.ManagedBearerSsoConnection +import software.aws.toolkits.jetbrains.core.credentials.ReauthSource import software.aws.toolkits.jetbrains.core.credentials.ToolkitConnection import software.aws.toolkits.jetbrains.core.credentials.ToolkitConnectionManager import software.aws.toolkits.jetbrains.core.credentials.maybeReauthProviderIfNeeded @@ -171,7 +172,7 @@ object CodeWhispererUtil { if (!isQExpired(project)) return false val tokenProvider = tokenProvider(project) ?: return false return try { - maybeReauthProviderIfNeeded(project, tokenProvider) { + maybeReauthProviderIfNeeded(project, ReauthSource.CODEWHISPERER, tokenProvider) { runInEdt { if (!CodeWhispererService.hasReAuthPromptBeenShown()) { notifyConnectionExpiredRequestReauth(project) @@ -256,7 +257,7 @@ object CodeWhispererUtil { val connection = ToolkitConnectionManager.getInstance(project).activeConnectionForFeature(CodeWhispererConnection.getInstance()) if (connection !is ManagedBearerSsoConnection) return pluginAwareExecuteOnPooledThread { - reauthConnectionIfNeeded(project, connection, isReAuth = true) + reauthConnectionIfNeeded(project, connection, isReAuth = true, reauthSource = ReauthSource.CODEWHISPERER) } } diff --git a/plugins/amazonq/codewhisperer/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/codewhisperer/util/CodeWhispererUtilTest.kt b/plugins/amazonq/codewhisperer/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/codewhisperer/util/CodeWhispererUtilTest.kt index 9f2a4c0161..e41bf55b11 100644 --- a/plugins/amazonq/codewhisperer/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/codewhisperer/util/CodeWhispererUtilTest.kt +++ b/plugins/amazonq/codewhisperer/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/codewhisperer/util/CodeWhispererUtilTest.kt @@ -16,6 +16,7 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.RegisterExtension import software.aws.toolkits.core.utils.test.aString import software.aws.toolkits.jetbrains.core.credentials.ManagedBearerSsoConnection +import software.aws.toolkits.jetbrains.core.credentials.ReauthSource import software.aws.toolkits.jetbrains.core.credentials.ToolkitAuthManager import software.aws.toolkits.jetbrains.core.credentials.ToolkitConnectionManager import software.aws.toolkits.jetbrains.core.credentials.reauthConnectionIfNeeded @@ -51,7 +52,7 @@ class CodeWhispererUtilTest { CodeWhispererUtil.reconnectCodeWhisperer(projectExtension.project) verify { - reauthConnectionIfNeeded(projectExtension.project, mockConnection, isReAuth = true) + reauthConnectionIfNeeded(projectExtension.project, mockConnection, isReAuth = true, reauthSource = ReauthSource.CODEWHISPERER) } } } diff --git a/plugins/core/jetbrains-community/resources/telemetryOverride.json b/plugins/core/jetbrains-community/resources/telemetryOverride.json index a2736ca7f6..8efc5b36ae 100644 --- a/plugins/core/jetbrains-community/resources/telemetryOverride.json +++ b/plugins/core/jetbrains-community/resources/telemetryOverride.json @@ -273,6 +273,11 @@ "type": "string", "description": "Comma-delimited list of enabled auths." }, + { + "name": "authRefreshSource", + "type": "string", + "description": "Source triggering token refresh" + }, { "name": "component", "allowedValues": [ @@ -813,6 +818,17 @@ "required": true } ] + }, + { + "name": "auth_sourceOfRefresh", + "description": "Source of user triggered refresh", + "metadata": [ + { + "type": "authRefreshSource", + "required": false + } + ] } + ] } diff --git a/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/LoginUtils.kt b/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/LoginUtils.kt index c9d76871e9..9b3641d762 100644 --- a/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/LoginUtils.kt +++ b/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/LoginUtils.kt @@ -198,7 +198,7 @@ fun authAndUpdateConfig( val connection = try { ToolkitAuthManager.getInstance().tryCreateTransientSsoConnection(updatedProfile) { connection -> - reauthConnectionIfNeeded(project, connection, onPendingToken) + reauthConnectionIfNeeded(project, connection, onPendingToken, reauthSource = ReauthSource.FRESH_AUTH) } } catch (e: Exception) { onError(e) diff --git a/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/ToolkitAuthManager.kt b/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/ToolkitAuthManager.kt index 48b1639224..ffaffe6f5a 100644 --- a/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/ToolkitAuthManager.kt +++ b/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/ToolkitAuthManager.kt @@ -27,6 +27,7 @@ import software.aws.toolkits.jetbrains.core.credentials.sso.bearer.BearerTokenPr import software.aws.toolkits.jetbrains.core.credentials.sso.bearer.InteractiveBearerTokenProvider import software.aws.toolkits.jetbrains.utils.runUnderProgressIfNeeded import software.aws.toolkits.resources.AwsCoreBundle +import software.aws.toolkits.telemetry.AuthTelemetry import software.aws.toolkits.telemetry.CredentialSourceId import software.aws.toolkits.telemetry.CredentialType import software.aws.toolkits.telemetry.Result @@ -135,6 +136,7 @@ fun loginSso( onPendingToken = onPendingToken, isReAuth = false, source = metadata?.sourceId, + reauthSource = ReauthSource.FRESH_AUTH ) } } catch (e: Exception) { @@ -182,6 +184,7 @@ fun loginSso( onPendingToken = onPendingToken, isReAuth = true, source = metadata?.sourceId, + reauthSource = ReauthSource.COMMON_LOGIN ) return@let connection } @@ -240,6 +243,7 @@ fun reauthConnectionIfNeeded( onPendingToken: (InteractiveBearerTokenProvider) -> Unit = {}, isReAuth: Boolean = false, source: String? = null, + reauthSource: ReauthSource? = ReauthSource.TOOLKIT, ): BearerTokenProvider { val tokenProvider = (connection.getConnectionSettings() as TokenConnectionSettings).tokenProvider.delegate as BearerTokenProvider if (tokenProvider is InteractiveBearerTokenProvider) { @@ -248,7 +252,7 @@ fun reauthConnectionIfNeeded( val startUrl = (connection as AwsBearerTokenConnection).startUrl var didReauth = false - maybeReauthProviderIfNeeded(project, tokenProvider) { + maybeReauthProviderIfNeeded(project, reauthSource, tokenProvider) { didReauth = true runUnderProgressIfNeeded(project, AwsCoreBundle.message("credentials.pending.title"), true) { try { @@ -301,6 +305,7 @@ fun reauthConnectionIfNeeded( // Return true if need to re-auth, false otherwise fun maybeReauthProviderIfNeeded( project: Project?, + reauthSource: ReauthSource? = ReauthSource.TOOLKIT, tokenProvider: BearerTokenProvider, onReauthRequired: (SsoOidcException?) -> Any, ): Boolean { @@ -314,12 +319,14 @@ fun maybeReauthProviderIfNeeded( BearerTokenAuthState.NEEDS_REFRESH -> { try { + getLogger().warn { "Starting token refresh" } return runUnderProgressIfNeeded(project, AwsCoreBundle.message("credentials.refreshing"), true) { tokenProvider.resolveToken() BearerTokenProviderListener.notifyCredUpdate(tokenProvider.id) return@runUnderProgressIfNeeded false } } catch (e: SsoOidcException) { + AuthTelemetry.sourceOfRefresh(authRefreshSource = reauthSource.toString()) getLogger().warn(e) { "Redriving bearer token login flow since token could not be refreshed" } onReauthRequired(e) return true @@ -332,6 +339,17 @@ fun maybeReauthProviderIfNeeded( } } +enum class ReauthSource { + CODEWHISPERER, + TOOLKIT, + Q_CHAT, + LOGIN_BROWSER, + CODEWHISPERER_STATUSBAR, + CODECATALYST, + COMMON_LOGIN, + FRESH_AUTH, +} + fun deleteSsoConnection(connection: ProfileSsoManagedBearerSsoConnection) = deleteSsoConnection(connection.configSessionName) diff --git a/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/profiles/ProfileCredentialProviderFactory.kt b/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/profiles/ProfileCredentialProviderFactory.kt index d9c2ca8d19..42ff13489a 100644 --- a/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/profiles/ProfileCredentialProviderFactory.kt +++ b/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/profiles/ProfileCredentialProviderFactory.kt @@ -41,6 +41,7 @@ import software.aws.toolkits.jetbrains.core.credentials.CredentialManager import software.aws.toolkits.jetbrains.core.credentials.InteractiveCredential import software.aws.toolkits.jetbrains.core.credentials.MfaRequiredInteractiveCredentials import software.aws.toolkits.jetbrains.core.credentials.PostValidateInteractiveCredential +import software.aws.toolkits.jetbrains.core.credentials.ReauthSource import software.aws.toolkits.jetbrains.core.credentials.RefreshConnectionAction import software.aws.toolkits.jetbrains.core.credentials.SsoRequiredInteractiveCredentials import software.aws.toolkits.jetbrains.core.credentials.ToolkitAuthManager @@ -133,7 +134,7 @@ class ProfileCredentialsIdentifierSso @TestOnly constructor( scopes = session.scopes.toList() ) ) - reauthConnectionIfNeeded(e.project, connection) + reauthConnectionIfNeeded(e.project, connection, reauthSource = ReauthSource.TOOLKIT) RefreshConnectionAction().actionPerformed(e) } } diff --git a/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/DiskCache.kt b/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/DiskCache.kt index 7485933e86..95e9882b59 100644 --- a/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/DiskCache.kt +++ b/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/DiskCache.kt @@ -102,7 +102,6 @@ class DiskCache( LOG.debug { "loadClientRegistration for $cacheKey" } val inputStream = clientRegistrationCache(cacheKey).tryInputStreamIfExists() ?: return null - return loadClientRegistration(inputStream) } diff --git a/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/SsoAccessTokenProvider.kt b/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/SsoAccessTokenProvider.kt index cbbe3b6d80..0eb42cc70f 100644 --- a/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/SsoAccessTokenProvider.kt +++ b/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/SsoAccessTokenProvider.kt @@ -432,6 +432,7 @@ class SsoAccessTokenProvider( requestId = requestId, result = Result.Failed ) + getLogger().warn("RefreshAccessTokenFailed: ${e.message}") throw e } } diff --git a/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/gettingstarted/GettingStartedAuthUtils.kt b/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/gettingstarted/GettingStartedAuthUtils.kt index 4cda831d98..23730e6ef4 100644 --- a/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/gettingstarted/GettingStartedAuthUtils.kt +++ b/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/gettingstarted/GettingStartedAuthUtils.kt @@ -8,6 +8,7 @@ import software.aws.toolkits.core.utils.tryOrNull import software.aws.toolkits.jetbrains.core.credentials.LegacyManagedBearerSsoConnection import software.aws.toolkits.jetbrains.core.credentials.ManagedBearerSsoConnection import software.aws.toolkits.jetbrains.core.credentials.ProfileSsoManagedBearerSsoConnection +import software.aws.toolkits.jetbrains.core.credentials.ReauthSource import software.aws.toolkits.jetbrains.core.credentials.ToolkitConnectionManager import software.aws.toolkits.jetbrains.core.credentials.loginSso import software.aws.toolkits.jetbrains.core.credentials.pinning.CodeWhispererConnection @@ -230,7 +231,7 @@ fun reauthenticateWithQ(project: Project) { val connection = ToolkitConnectionManager.getInstance(project).activeConnectionForFeature(QConnection.getInstance()) if (connection !is ManagedBearerSsoConnection) return pluginAwareExecuteOnPooledThread { - reauthConnectionIfNeeded(project, connection, isReAuth = true) + reauthConnectionIfNeeded(project, connection, isReAuth = true, reauthSource = ReauthSource.Q_CHAT) } } diff --git a/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/webview/LoginBrowser.kt b/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/webview/LoginBrowser.kt index e9f9e52a0a..563353ae68 100644 --- a/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/webview/LoginBrowser.kt +++ b/plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/webview/LoginBrowser.kt @@ -27,6 +27,7 @@ import software.aws.toolkits.core.utils.tryOrNull import software.aws.toolkits.jetbrains.core.coroutines.projectCoroutineScope import software.aws.toolkits.jetbrains.core.credentials.AwsBearerTokenConnection import software.aws.toolkits.jetbrains.core.credentials.Login +import software.aws.toolkits.jetbrains.core.credentials.ReauthSource import software.aws.toolkits.jetbrains.core.credentials.ToolkitConnection import software.aws.toolkits.jetbrains.core.credentials.ToolkitConnectionManager import software.aws.toolkits.jetbrains.core.credentials.pinning.CodeCatalystConnection @@ -380,7 +381,7 @@ abstract class LoginBrowser( protected fun reauth(connection: ToolkitConnection?) { if (connection is AwsBearerTokenConnection) { loginWithBackgroundContext { - reauthConnectionIfNeeded(project, connection, onPendingToken, isReAuth = true) + reauthConnectionIfNeeded(project, connection, onPendingToken, isReAuth = true, reauthSource = ReauthSource.LOGIN_BROWSER) } stopAndClearBrowserOpenTimer() } diff --git a/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/credentials/ConnectionSettingsMenuBuilder.kt b/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/credentials/ConnectionSettingsMenuBuilder.kt index 0ab9e33ef0..bf23a37489 100644 --- a/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/credentials/ConnectionSettingsMenuBuilder.kt +++ b/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/credentials/ConnectionSettingsMenuBuilder.kt @@ -244,7 +244,7 @@ class ConnectionSettingsMenuBuilder private constructor() { addAll( object : DumbAwareAction(message("credentials.individual_identity.reconnect")) { override fun actionPerformed(e: AnActionEvent) { - reauthConnectionIfNeeded(e.project, value, isReAuth = true) + reauthConnectionIfNeeded(e.project, value, isReAuth = true, reauthSource = ReauthSource.TOOLKIT) e.project?.let { ToolkitConnectionManager.getInstance(it).switchConnection(value) } } diff --git a/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/credentials/sono/CodeCatalystCredentialManager.kt b/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/credentials/sono/CodeCatalystCredentialManager.kt index ac1412e080..4016e87c23 100644 --- a/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/credentials/sono/CodeCatalystCredentialManager.kt +++ b/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/credentials/sono/CodeCatalystCredentialManager.kt @@ -12,6 +12,7 @@ import software.aws.toolkits.core.telemetry.DefaultMetricEvent import software.aws.toolkits.core.utils.tryOrNull import software.aws.toolkits.jetbrains.core.AwsResourceCache import software.aws.toolkits.jetbrains.core.credentials.AwsBearerTokenConnection +import software.aws.toolkits.jetbrains.core.credentials.ReauthSource import software.aws.toolkits.jetbrains.core.credentials.ToolkitConnectionManager import software.aws.toolkits.jetbrains.core.credentials.logoutFromSsoConnection import software.aws.toolkits.jetbrains.core.credentials.maybeReauthProviderIfNeeded @@ -78,7 +79,7 @@ class CodeCatalystCredentialManager { fun promptAuth(): BearerTokenProvider? { connection()?.let { val tokenProvider = provider(it) - val reauthRequired = maybeReauthProviderIfNeeded(project, tokenProvider) {} + val reauthRequired = maybeReauthProviderIfNeeded(project, ReauthSource.CODECATALYST, tokenProvider) {} if (reauthRequired) { val useCurrentCredentials = computeOnEdt { diff --git a/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/explorer/devToolsTab/nodes/actions/SonoLogin.kt b/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/explorer/devToolsTab/nodes/actions/SonoLogin.kt index 2b1cd63470..9a29240783 100644 --- a/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/explorer/devToolsTab/nodes/actions/SonoLogin.kt +++ b/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/explorer/devToolsTab/nodes/actions/SonoLogin.kt @@ -7,6 +7,7 @@ import com.intellij.icons.AllIcons import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.application.runInEdt import com.intellij.openapi.project.DumbAwareAction +import software.aws.toolkits.jetbrains.core.credentials.ReauthSource import software.aws.toolkits.jetbrains.core.credentials.ToolkitConnectionManager import software.aws.toolkits.jetbrains.core.credentials.pinning.CodeCatalystConnection import software.aws.toolkits.jetbrains.core.credentials.reauthConnectionIfNeeded @@ -23,7 +24,7 @@ class SonoLogin : DumbAwareAction(AllIcons.Actions.Execute) { pluginAwareExecuteOnPooledThread { val connectionManager = ToolkitConnectionManager.getInstance(project) connectionManager.activeConnectionForFeature(CodeCatalystConnection.getInstance())?.let { - reauthConnectionIfNeeded(project, it, isReAuth = true) + reauthConnectionIfNeeded(project, it, isReAuth = true, reauthSource = ReauthSource.CODECATALYST) project.refreshDevToolTree() } ?: run { runInEdt { diff --git a/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/gettingstarted/ToolkitAuthUtils.kt b/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/gettingstarted/ToolkitAuthUtils.kt index 7276a00b23..c0c9c76a2a 100644 --- a/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/gettingstarted/ToolkitAuthUtils.kt +++ b/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/gettingstarted/ToolkitAuthUtils.kt @@ -9,6 +9,7 @@ import com.intellij.openapi.ui.Messages import software.aws.toolkits.jetbrains.core.credentials.AwsBearerTokenConnection import software.aws.toolkits.jetbrains.core.credentials.ConfigFilesFacade import software.aws.toolkits.jetbrains.core.credentials.DefaultConfigFilesFacade +import software.aws.toolkits.jetbrains.core.credentials.ReauthSource import software.aws.toolkits.jetbrains.core.credentials.UserConfigSsoSessionProfile import software.aws.toolkits.jetbrains.core.credentials.authAndUpdateConfig import software.aws.toolkits.jetbrains.core.credentials.profiles.SsoSessionConstants @@ -42,7 +43,7 @@ fun rolePopupFromConnection( Messages.showErrorDialog(project, e.message, message("gettingstarted.explorer.iam.add")) } ?: return@runInEdt } else { - reauthConnectionIfNeeded(project, connection) + reauthConnectionIfNeeded(project, connection, reauthSource = ReauthSource.TOOLKIT) connection }.getConnectionSettings().tokenProvider diff --git a/plugins/toolkit/jetbrains-ultimate/src/software/aws/toolkits/jetbrains/services/rds/auth/IamAuth.kt b/plugins/toolkit/jetbrains-ultimate/src/software/aws/toolkits/jetbrains/services/rds/auth/IamAuth.kt index 4203e3f2be..2747857eaa 100644 --- a/plugins/toolkit/jetbrains-ultimate/src/software/aws/toolkits/jetbrains/services/rds/auth/IamAuth.kt +++ b/plugins/toolkit/jetbrains-ultimate/src/software/aws/toolkits/jetbrains/services/rds/auth/IamAuth.kt @@ -22,6 +22,7 @@ import software.aws.toolkits.core.utils.getLogger import software.aws.toolkits.core.utils.info import software.aws.toolkits.jetbrains.core.coroutines.projectCoroutineScope import software.aws.toolkits.jetbrains.core.credentials.CredentialManager +import software.aws.toolkits.jetbrains.core.credentials.ReauthSource import software.aws.toolkits.jetbrains.core.credentials.ToolkitAuthManager import software.aws.toolkits.jetbrains.core.credentials.UserConfigSsoSessionProfile import software.aws.toolkits.jetbrains.core.credentials.profiles.ProfileCredentialsIdentifierSso @@ -117,7 +118,7 @@ class IamAuth : DatabaseAuthProviderCompatabilityAdapter { ) ) - reauthConnectionIfNeeded(project, ssoConnection) + reauthConnectionIfNeeded(project, ssoConnection, reauthSource = ReauthSource.TOOLKIT) return connection }