SDK
SDK Golang v3.x
2

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")
}