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)
Arguments | Type | Description |
---|---|---|
strategy | string | the strategy to use |
credentials | string | the new credentials |
options | QueryOptions | QueryOptions object containing query options |
Options #
Additional query options
Property | Type | Description | Default |
---|---|---|---|
Queuable | boolean | Make this request queuable or not | true |
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")
}
Edit this page on Github(opens new window)