@@ -20,7 +20,7 @@ import { builderIdStartUrl } from '../../../../auth/sso/constants'
2020import { RegionProfile , vsCodeState } from '../../../../codewhisperer/models/model'
2121import { randomUUID } from '../../../../shared/crypto'
2222import globals from '../../../../shared/extensionGlobals'
23- import { telemetry } from '../../../../shared/telemetry/telemetry'
23+ import { CredentialType , telemetry } from '../../../../shared/telemetry/telemetry'
2424import { ProfileSwitchIntent } from '../../../../codewhisperer/region/regionProfileManager'
2525
2626const className = 'AmazonQLoginWebview'
@@ -204,6 +204,15 @@ export class AmazonQLoginWebview extends CommonAuthWebview {
204204 // Defining separate auth function to emit telemetry before returning from this method
205205 await globals . globalState . update ( 'recentIamKeys' , { accessKey : accessKey } )
206206 await globals . globalState . update ( 'recentRoleArn' , { roleArn : roleArn } )
207+ let credentialsType : CredentialType | undefined
208+ if ( ! sessionToken && ! roleArn ) {
209+ credentialsType = 'staticProfile'
210+ } else if ( roleArn ) {
211+ credentialsType = 'assumeRoleProfile'
212+ } else {
213+ credentialsType = 'staticSessionProfile'
214+ }
215+
207216 const runAuth = async ( ) : Promise < AuthError | undefined > => {
208217 try {
209218 await AuthUtil . instance . login_iam ( accessKey , secretKey , sessionToken , roleArn )
@@ -225,6 +234,7 @@ export class AmazonQLoginWebview extends CommonAuthWebview {
225234 this . storeMetricMetadata ( {
226235 credentialSourceId : 'sharedCredentials' ,
227236 authEnabledFeatures : 'codewhisperer' ,
237+ credentialType : credentialsType ,
228238 ...this . getResultForMetrics ( result ) ,
229239 } )
230240 this . emitAuthMetric ( )
0 commit comments