Skip to content
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

Authentication fails using ibm-credentials.env file #73

Closed
esb opened this issue Aug 8, 2019 · 2 comments
Closed

Authentication fails using ibm-credentials.env file #73

esb opened this issue Aug 8, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@esb
Copy link

esb commented Aug 8, 2019

Describe the bug
Authentication always fails when trying to use the downloaded ibm-credentials.env file.

To Reproduce
Create a IBM_CREDENTIALS_FILE environment variable and point to the downloaded credentials file. Simple create a service using only the version parameter, and it will fail to authenticate.

Expected behavior
No authentication errors.

Problem Resolution
The bug is pretty simple to fix. The ibm_cloud_sdk_core uses the display_name parameter to load the authentication variables from the file. If this parameter is not set, then the credentials file is not loaded.

All of the initialization routines in this package set the display_name parameter AFTER the call to super, so the value is never passed to the super class (ibm_cloud_sdk_core). The display_name parameter needs to be set before calling super.

As a side comment, even though this fixes the loading and parsing of the credentials file, code is missing from the base_service module to actually use the apikey and url read from the credentials file. It looks like this functionality was never actually finished.

@esb esb added the bug Something isn't working label Aug 8, 2019
@mamoonraja
Copy link
Member

Thanks a lot for opening the issue, I am debugging and will have a fix out soon.

@mamoonraja
Copy link
Member

The issue has been fixed in 0.19.1, I have tested the functionality by downloading the credentials file and trying it with the following snippet:

assistant = IBMWatson::AssistantV1.new(
  version: "2018-02-16"
)
response = assistant.list_workspaces.result
puts JSON.pretty_generate(response)

Feel free to open more issues or even contribute with a PR :) Please let us know if you have any more feedback as we are targeting our first major release in #56.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants