SDK
SDK Golang v2.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

GetMyCredentials #

Returns the current user's credential information for the specified <strategy>. The data returned will depend on the specified strategy. The result can be an empty object.

Arguments #

func (a *Auth) GetMyCredentials(strategy string, options types.QueryOptions) (json.RawMessage, error)
ArgumentsTypeDescriptionRequired
strategy
string
the strategy to useyes
options
QueryOptions
QueryOptions object containing query optionsyes

Options #

Additional query options

PropertyTypeDescriptionDefault
Queuable
bool
Make this request queuable or nottrue

Return #

Returns a string representing a JSON with the credentials for the provided authentication strategy and an error or nil.

Usage #

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