SDK
SDK Golang v3.x
2

ValidateMyCredentials #

Validates the current user's credentials for the specified <strategy>. The result field is true if the provided credentials are valid; otherwise an error is triggered. This route does not actually create or modify the user credentials. The credentials to send will depend on the authentication plugin and authentication strategy.

Arguments #

func (a *Auth) ValidateMyCredentials(strategy string, credentials json.RawMessage, options types.QueryOptions) (bool, error)
ArgumentsTypeDescription
strategy
string
the strategy to use
credentials
string
the new credentials
options
QueryOptions
QueryOptions object containing query options

Options #

Additional query options

PropertyTypeDescriptionDefault
Queuable
boolean
Make this request queuable or nottrue

Usage #

kuzzle.Auth.Login("local", json.RawMessage("{\"username\":\"foo\",\"password\":\"bar\"}"), nil)
_, err := kuzzle.Auth.ValidateMyCredentials("local", json.RawMessage("{\"username\":\"foo\",\"password\":\"bar\"}"), nil)
if err != nil {
  log.Fatal(err)
} else {
  fmt.Println("Success")
}