Skip to content

Commit 4255f3f

Browse files
committed
Prevent passing in a JWT as athe access key.
1 parent 72416cf commit 4255f3f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/serviceClientTokenProvider.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ function getIssuer(unsanitizedAuthressCustomDomain, decodedAccessKey) {
1313

1414
class ServiceClientTokenProvider {
1515
constructor(accessKey, authressCustomDomain) {
16+
if (accessKey.startsWith('eyJ')) {
17+
throw new InvalidAccessKeyError();
18+
}
19+
1620
const accountId = accessKey.split('.')[2];
1721
this.accountId = accountId;
1822
this.authressCustomDomain = authressCustomDomain;

0 commit comments

Comments
 (0)