Skip to content

Commit c137de9

Browse files
authored
Don't use authorization_grant for non-commerical regions or legacy sso (#4468)
* Don't use `authorization_grant` for non-commerical regions or legacy sso Requests will fail on service side * Update SsoAccessTokenProvider.kt * changelog
1 parent 12205a5 commit c137de9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Don't use `authorization_grant` when performing SSO login with legacy SSO or non-commercial AWS regions"
4+
}

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/SsoAccessTokenProvider.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ class SsoAccessTokenProvider(
102102
return it
103103
}
104104

105-
val token = if (isNewAuthPkce) {
105+
val isCommercialRegion = !ssoRegion.startsWith("us-gov") && !ssoRegion.startsWith("us-iso") && !ssoRegion.startsWith("cn")
106+
val token = if (isCommercialRegion && isNewAuthPkce && scopes.isNotEmpty()) {
106107
pollForPkceToken()
107108
} else {
108109
pollForDAGToken()

0 commit comments

Comments
 (0)