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

feature: Add support for using ldap primary auth method #392

Merged
merged 4 commits into from
May 3, 2023

Conversation

elimt
Copy link
Member

@elimt elimt commented May 3, 2023

  • Enable LDAP authentication through TF Provider
  • Enable easier LDAP authentication by automatically setting the auth_method_id for the Terraform provider if LDAP is the primary auth method or only auth method.
  • Combine fields for auth_method login_name & password
  • Bump up github.com/jimlambrt/gldap & github.com/hashicorp/boundary to pull in needed changes for TF changes

Using the Primary Auth Method(LDAP) in Global Scope

provider "boundary" {
  addr                            = "http://127.0.0.1:9200"
  auth_method_login_name = "myuser"
  auth_method_password   = "passpass"
}

Using the Primary Auth Method(LDAP) in a passed-in scope:

provider "boundary" {
  addr                            = "http://127.0.0.1:9200"
  auth_method_login_name = "myuser"
  auth_method_password   = "passpass"
  scope_id                        = "s_1234567890"
}

Using auth_method_id (traditional)

provider "boundary" {
  addr                            = "http://127.0.0.1:9200"
  auth_method_id                  = "ampw_1234567890"
  auth_method_login_name = "myuser"
  auth_method_password   = "passpass"
}

Considerations

password & LDAP auth methods both need a login_name & password for Terraform Provider.
Instead of having separate Terraform password_auth_method_* & ldap_auth_method_* fields that take the same information, a new auth_method_login_name& auth_method_password has been added to pass in data required by both auth methods.
password_auth_method_login_name & password_auth_method_password fields have been set to deprecated with a recommendation to use auth_method_login_name& auth_method_password fields instead.

@elimt elimt added this to the 0.13.x milestone May 3, 2023
@elimt elimt requested review from jimlambrt and ddebko May 3, 2023 15:24
@elimt elimt changed the title feature: Add support for using ldap for auth if it's the primary auth method feature: Add support for using ldap primary auth method May 3, 2023
Copy link
Contributor

@jimlambrt jimlambrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, we can remove some unused bits.

internal/provider/provider_test.go Outdated Show resolved Hide resolved
internal/provider/provider_test.go Outdated Show resolved Hide resolved
internal/provider/provider_test.go Outdated Show resolved Hide resolved
internal/provider/provider_test.go Outdated Show resolved Hide resolved
internal/provider/provider_test.go Outdated Show resolved Hide resolved
internal/provider/provider_test.go Outdated Show resolved Hide resolved
@elimt elimt requested a review from jimlambrt May 3, 2023 16:21
Copy link
Contributor

@jimlambrt jimlambrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty!

Copy link
Contributor

@ddebko ddebko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great

@elimt elimt merged commit f70d3b3 into main May 3, 2023
@elimt elimt deleted the elimt-ldap-auth-method-support branch May 3, 2023 18:33
grantorchard pushed a commit to grantorchard/terraform-provider-boundary that referenced this pull request Aug 28, 2023
* Add support for using LDAP for authentication if it's the primary auth method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants