onelogin / terraform-provider-onelogin

GNU General Public License v3.0
27 stars 19 forks source link

provider credential source #112

Open rjhornsby opened 1 year ago

rjhornsby commented 1 year ago

The provider's new openapi-based design presently requires a separate, manual REST operation to obtain an API token from your OL API credentials (client_id/client_secret).

The provider should obtain the token it needs by using the values of the env vars ONELOGIN_CLIENT_ID and ONELOGIN_CLIENT_SECRET.

Jmfwolf commented 1 year ago

Thank you for expounding upon this part of the README

I am aware of the issue and it is being worked on. Given the requests for more features and bug fixes, I am only able to manage so many things at once. I will keep you updated as things progress. If you have any recommendations on the specification changes for the provider tooling, I am more than willing to review PR's

rjhornsby commented 1 year ago

For anyone else facing this, there is a workaround by using a separate provider to get the oauth token svenhamers/oauth.

data.tf:

data "oauth_token" "onelogin" {
  client_id      = var.u_onelogin_client_id
  client_secret  = var.u_onelogin_client_secret
  token_endpoint = var.onelogin_oauth_token_url
}

onelogin_oauth_token_url is https://<your_domain>.onelogin.com/auth/oauth2/v2/token

providers.tf:

provider "onelogin" {
  apikey_auth = data.oauth_token.onelogin.token
}
Jmfwolf commented 1 year ago

@rjhornsby I am going to address this and the other issues you have brought up in the new implementation

rjhornsby commented 1 year ago

sounds good. thanks for the update

Jmfwolf commented 1 year ago

@rjhornsby In order to resolve the SAML issues in the terraform provider I need to create a new Go SDK. As a contributor to both repos your insight is appreciated