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

OS_AUTH_TOKEN/API_KEY issue with openstack provider #5802

Closed
pryorda opened this issue Mar 23, 2016 · 15 comments · Fixed by #6081
Closed

OS_AUTH_TOKEN/API_KEY issue with openstack provider #5802

pryorda opened this issue Mar 23, 2016 · 15 comments · Fixed by #6081
Labels

Comments

@pryorda
Copy link

pryorda commented Mar 23, 2016

No matter if I use keystone v2 or v3 I continue to get this failure ( * The base Identity V2 API does not accept authentication by APIKey) when connecting using APIKEY/AUTH Token . Any guidance is appreciated.

(1:527)$ terraform --version
Terraform v0.6.14

Error refreshing state: 1 error(s) occurred:

  • The base Identity V2 API does not accept authentication by APIKey
@jtopjian
Copy link
Contributor

Hi there,

Yes, thank you for pointing this out. It's been something I've been meaning to look into and resolve. The api_key attribute was accidentally added as a way to enable token authentication, but api_key serves a totally different purpose: it acts as a secondary password for specialized OpenStack environments such as Rackspace.

AFAIK, the vast majority of OpenStack environments do not support an API Key authentication method. At minimum, I need to update the docs to reflect this.

The secondary issue here is how one can authenticate with a token. Coincidentally, I just close #4430 which talks about tokens a little bit. What I've found is that even if you authenticate with a token in Gophercloud (the underlying Golang OpenStack library), that token is simply used to create another token, so it's not useful in situations when you want to use a persistent token throughout your entire session.

Let me know if this helps.

I'll get a doc patch shortly to better describe api_key.

@pryorda
Copy link
Author

pryorda commented Mar 23, 2016

Is there a way to use OS_AUTH_TOKEN rather then password? #4430 did not really go into any details of what values need to be set for it to work.

@jtopjian
Copy link
Contributor

At this time it's not possible to use OS_AUTH_TOKEN rather than a password. The testing I did in #4430 either reported the generated token from the username/password combination or was a test with Gophercloud directly.

I can look into adding OS_AUTH_TOKEN functionality, but with the understanding that specifying a token will simply create another token once authenticated. I just want to be explicit about that because I think people use token authentication for a few different reasons; two being: cut down on token traffic in the underlying infrastructure and not using a password for authentication. This would help the latter case.

@pryorda
Copy link
Author

pryorda commented Mar 23, 2016

Yeah that would be fine. Tokens in source files usually expire, passwords are permanent. We are trying to get by having to store the password, but still allow it be automated without having to prompt for a password. We got past this by storing the password as an ENV variable and would like to remove this and just use a auth_token/username pair.

BTW, Thanks for all the fast responses. This is the second issue you jumped on within 24 hours 👍

@jtopjian
Copy link
Contributor

No problem at all - It's all in the gmail filters 😉

This sounds good and as I wrote out my last response even wondered why it hasn't been done yet. I'll put this on my TODO.

@jtopjian
Copy link
Contributor

jtopjian commented Apr 8, 2016

@pryorda Sorry for the delay. I've just opened #6081. Would you be able to test it out and let me know what you think?

@pryorda
Copy link
Author

pryorda commented Apr 10, 2016

This worked as expected.

@jtopjian
Copy link
Contributor

That's great news! Thank you for testing it out.

I'm going to leave the PR opened a little longer than usual to see if anyone else will come across and comment on it. It's making some changes to the login configuration (albeit minor and retains backwards compatibility) so I want to be a little cautious.

@pryorda
Copy link
Author

pryorda commented Apr 11, 2016

Did you have to change anything in gophercloud or strictly the 3 files that were part of this commit?

@jtopjian
Copy link
Contributor

It was all strictly in Terraform.

@thishitshome
Copy link

thishitshome commented May 2, 2016

Maybe not worth opening a new bug for this, but when I am attempting to use token against a v3 keystone auth_url, terraform outputs the following error, saying it requires a password.

"
Error refreshing state: 1 error(s) occurred:

* You must provide a password to authenticate
"

Specifying a v2.0 keystone URL allows it to connect, but I get an authentication error back from keystone as v2.0 obviously doesn't support v3 project-scoped tokens.

@pryorda
Copy link
Author

pryorda commented May 2, 2016

What Variables do you have set and what os?

@thishitshome
Copy link

thishitshome commented May 2, 2016

CentOS 6.6, 2.6.32-504.30.3.el6.x86_64

example.tf:

provider "openstack" {
auth_url = "https://devcloud.mycompany.com:5000/v3"
domain_name = "development"
tenant_name = "dev2"
token = ""
}

No "OS_" environment variables are set; however I get the same behavior if I do set OS_AUTH_TOKEN, though.

@jtopjian
Copy link
Contributor

jtopjian commented May 3, 2016

@delias- I think this is worth opening a new issue for 😄

@ghost
Copy link

ghost commented Apr 26, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants