NewLDAPIdentity returns new credentials object that uses LDAP Identity.
(stsEndpoint, ldapUsername, ldapPassword string, optFuncs ...LDAPIdentityOpt)
| 84 | // NewLDAPIdentity returns new credentials object that uses LDAP |
| 85 | // Identity. |
| 86 | func NewLDAPIdentity(stsEndpoint, ldapUsername, ldapPassword string, optFuncs ...LDAPIdentityOpt) (*Credentials, error) { |
| 87 | l := LDAPIdentity{ |
| 88 | STSEndpoint: stsEndpoint, |
| 89 | LDAPUsername: ldapUsername, |
| 90 | LDAPPassword: ldapPassword, |
| 91 | } |
| 92 | for _, optFunc := range optFuncs { |
| 93 | optFunc(&l) |
| 94 | } |
| 95 | return New(&l), nil |
| 96 | } |
| 97 | |
| 98 | // LDAPIdentityOpt is a function type used to configured the LDAPIdentity |
| 99 | // instance. |