Closed bourdakos1 closed 3 years ago
That's a good question. It is possible with the Java SDK, which makes me think it should be possible. I'll take a look and provide an update.
Yeah, looks like it's as easy as just providing a token
instead of an apiKeyId
during client creation. Here's the relevant code: https://github.com/IBM/ibm-cos-sdk-js/blob/5d776bcb86f5b715cf0422107fdfc467eb0eb39e/lib/iam/token_manager.js#L76
Thanks, I wasn't able to get token
working, but I was able to pass a tokenManager
:
new COS.S3({
endpoint: "https://s3.us.cloud-object-storage.appdomain.cloud",
serviceInstanceId: "...",
// @ts-ignore
tokenManager: {
getToken: () => ({
accessToken: token,
}),
},
});
Neither token
or tokenManager
are part of the typedefs
Has your issue been resolved?
Not exactly, I was able to do a work around, but there doesn’t seem to be an official way to do this?
@bourdakos1 Your resolution would be the "official" one I would suggest. There currently is no support for supplying a pre-fetched IAM token. For cases like this, we suggest extending the token manager with the behavior you are looking for. Also, re: typedefs, I've opened an internal ticket.
If this cover everything, please close this as resolved.
okay great, yea the typedef fix would cover everything thanks :)
Is it possible to use this sdk with only a service instance ID and an access token? (no api key)