@@ -26,7 +26,7 @@ import { AwsLoginWithBrowser, AwsRefreshCredentials, telemetry } from '../../sha
2626import { indent , toBase64URL } from '../../shared/utilities/textUtilities'
2727import { AuthSSOServer } from './server'
2828import { CancellationError , sleep } from '../../shared/utilities/timeoutUtils'
29- import { getIdeProperties , isAmazonQ , isCloud9 } from '../../shared/extensionUtilities'
29+ import { isAmazonQ } from '../../shared/extensionUtilities'
3030import { randomBytes , createHash } from 'crypto'
3131import { localize } from '../../shared/utilities/vsCodeUtils'
3232import { randomUUID } from '../../shared/crypto'
@@ -39,6 +39,7 @@ import { asStringifiedStack } from '../../shared/telemetry/spans'
3939import { showViewLogsMessage } from '../../shared/utilities/messages'
4040import _ from 'lodash'
4141import { builderIdStartUrl } from './constants'
42+ import { clientName } from '../utils'
4243
4344export const authenticationPath = 'sso/authenticated'
4445
@@ -451,10 +452,9 @@ function getSessionDuration(id: string) {
451452 */
452453export class DeviceFlowAuthorization extends SsoAccessTokenProvider {
453454 override async registerClient ( ) : Promise < ClientRegistration > {
454- const companyName = getIdeProperties ( ) . company
455455 return this . oidc . registerClient (
456456 {
457- clientName : isCloud9 ( ) ? ` ${ companyName } Cloud9` : ` ${ companyName } IDE Extensions for VSCode` ,
457+ clientName : clientName ( ) ,
458458 clientType : clientRegistrationType ,
459459 scopes : this . profile . scopes ,
460460 } ,
@@ -556,11 +556,10 @@ export class DeviceFlowAuthorization extends SsoAccessTokenProvider {
556556 */
557557class AuthFlowAuthorization extends SsoAccessTokenProvider {
558558 override async registerClient ( ) : Promise < ClientRegistration > {
559- const companyName = getIdeProperties ( ) . company
560559 return this . oidc . registerClient (
561560 {
562561 // All AWS extensions (Q, Toolkit) for a given IDE use the same client name.
563- clientName : isCloud9 ( ) ? ` ${ companyName } Cloud9` : ` ${ companyName } IDE Extensions for VSCode` ,
562+ clientName : clientName ( ) ,
564563 clientType : clientRegistrationType ,
565564 scopes : this . profile . scopes ,
566565 grantTypes : [ authorizationGrantType , refreshGrantType ] ,
@@ -666,11 +665,10 @@ class WebAuthorization extends SsoAccessTokenProvider {
666665 private redirectUri = 'http://127.0.0.1:54321/oauth/callback'
667666
668667 override async registerClient ( ) : Promise < ClientRegistration > {
669- const companyName = getIdeProperties ( ) . company
670668 return this . oidc . registerClient (
671669 {
672670 // All AWS extensions (Q, Toolkit) for a given IDE use the same client name.
673- clientName : isCloud9 ( ) ? ` ${ companyName } Cloud9` : ` ${ companyName } IDE Extensions for VSCode` ,
671+ clientName : clientName ( ) ,
674672 clientType : clientRegistrationType ,
675673 scopes : this . profile . scopes ,
676674 grantTypes : [ authorizationGrantType , refreshGrantType ] ,
0 commit comments