New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'accessToken' of undefined #52
Comments
You'll still need an IAM authentication uses refreshable tokens for short-lived authentication so that in the event of a hijacked request the access window is limited. It sounds like an invalid response was given for the authentication request, but that is generally handled and returned back with an error saying as much. In this case it looks like it accepted an invalid token which contained no auth information. May I ask for a stack trace if you have one? You may be able to fix this by adding the following to your constructor. const client = new COS.S3({
endpoint: '<endpoint>',
ibmAuthEndpoint: 'https://iam.cloud.ibm.com/identity/token'
}); If not, let me know and I can look into it further. |
I think the root cause for this issue is #55 |
Duplicate of #55 |
I've replicated the issue and a fix will be included in the upcoming October release. |
@nasht00 The issue should be resolve in the new |
Truth is this happened a while ago, I'm not sure even sure I ended up using it. |
Closing due to inactivity. If you continue to experience this error please let us know and we'll re-open. |
First of all, I need a confirmation. If I use service credentials stored in
~/.bluemix/cos_credentials
per the documentation, then I don't need to pass anything to the constructor right?I've created the following file
~/.bluemix/cos_credentials
(redacted):The empty constructor did not throw any error. Then I tried to create a bucket per the sample:
And I get:
TypeError: Cannot read property 'accessToken' of undefined
What is accessToken? It is not defined either in the cos_credentials nor in the constructor options...
The text was updated successfully, but these errors were encountered: