Revamp authenticate (#1025)
This commit is contained in:
1 parent
aa570f4e48
commit
6605b4c9f8
14 files changed
+276
-207
No files matched your search
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/hashicorp/boundary/api/authtokens"
|
||||
)
|
||||
|
||||
func (c *Client) Authenticate(ctx context.Context, authMethodId string, credentials map[string]interface{}, opt ...Option) (*authtokens.AuthTokenReadResult, error) {
|
||||
func (c *Client) Authenticate(ctx context.Context, authMethodId, command string, attributes map[string]interface{}, opt ...Option) (*authtokens.AuthTokenReadResult, error) {
|
||||
if c.client == nil {
|
||||
return nil, fmt.Errorf("nil client in Authenticate request")
|
||||
}
|
||||
@@ -15,7 +15,8 @@ func (c *Client) Authenticate(ctx context.Context, authMethodId string, credenti
|
||||
_, apiOpts := getOpts(opt...)
|
||||
|
||||
reqBody := map[string]interface{}{
|
||||
"credentials": credentials,
|
||||
"command": command,
|
||||
"attributes": attributes,
|
||||
}
|
||||
|
||||
req, err := c.client.NewRequest(ctx, "POST", fmt.Sprintf("auth-methods/%s:authenticate", authMethodId), reqBody, apiOpts...)
|
||||
|
||||
Reference in new issue
Block a user