Skip to content

Commit a4eb7a2

Browse files
committed
Fix authentication errors thrown due to unformatted private keys being used for refresh access tokens in IAM and OAUTH
1 parent 34b8f63 commit a4eb7a2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

doc/src/release_notes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ Thin Mode Changes
5959
#) Fixed bug with :meth:`dbObject.deleteElement()` which did not update the
6060
keys of associative arrays when an element was deleted.
6161

62+
#) Fixed issue with IAM token based authentication which allows unformatted
63+
private keys to be used for refreshed access tokens leading to token
64+
authentication errors.
65+
6266
Thick Mode Changes
6367
++++++++++++++++++
6468

lib/thin/pool.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022, 2024, Oracle and/or its affiliates.
1+
// Copyright (c) 2022, 2025, Oracle and/or its affiliates.
22

33
//-----------------------------------------------------------------------------
44
//
@@ -211,7 +211,7 @@ class ThinPoolImpl extends PoolImpl {
211211
}
212212
} else if (typeof accessToken === 'object') {
213213
clonedAttrs.token = accessToken.token;
214-
clonedAttrs.privateKey = accessToken.privateKey;
214+
clonedAttrs.privateKey = util.denormalizePrivateKey(accessToken.privateKey);
215215
if (util.isTokenExpired(clonedAttrs.token)) {
216216
// IAM token is expired
217217
errors.throwErr(errors.ERR_TOKEN_HAS_EXPIRED);

0 commit comments

Comments
 (0)