File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ export class ServerManagerAuthenticationProvider implements AuthenticationProvid
23
23
public static label = AUTHENTICATION_PROVIDER_LABEL ;
24
24
public static secretKeyPrefix = "credentialProvider:" ;
25
25
public static sessionId ( serverName : string , userName : string ) : string {
26
- return `${ serverName } /${ userName } ` ;
26
+ const canonicalUserName = userName . toLowerCase ( ) ;
27
+ return `${ serverName } /${ canonicalUserName } ` ;
27
28
}
28
29
public static credentialKey ( sessionId : string ) : string {
29
30
return `${ ServerManagerAuthenticationProvider . secretKeyPrefix } ${ sessionId } ` ;
@@ -56,9 +57,9 @@ export class ServerManagerAuthenticationProvider implements AuthenticationProvid
56
57
await this . _ensureInitialized ( ) ;
57
58
let sessions = this . _sessions ;
58
59
59
- // Filter to return only those that match all supplied scopes, which are positional.
60
+ // Filter to return only those that match all supplied scopes, which are positional and case-insensitive .
60
61
for ( let index = 0 ; index < scopes . length ; index ++ ) {
61
- sessions = sessions . filter ( ( session ) => session . scopes [ index ] === scopes [ index ] ) ;
62
+ sessions = sessions . filter ( ( session ) => session . scopes [ index ] === scopes [ index ] . toLowerCase ( ) ) ;
62
63
}
63
64
return sessions ;
64
65
}
Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ export class ServerManagerAuthenticationSession implements AuthenticationSession
11
11
public readonly userName : string ,
12
12
password : string ,
13
13
) {
14
+ const canonicalUserName = userName . toLowerCase ( ) ;
14
15
this . id = ServerManagerAuthenticationProvider . sessionId ( serverName , userName ) ;
15
16
this . accessToken = password ;
16
- this . account = { id : userName , label : `${ userName } on ${ serverName } ` } ;
17
- this . scopes = [ serverName , userName ] ;
17
+ this . account = { id : canonicalUserName , label : `${ userName } on ${ serverName } ` } ;
18
+ this . scopes = [ serverName , canonicalUserName ] ;
18
19
}
19
20
}
You can’t perform that action at this time.
0 commit comments