UserOIDCClaims returns the merged OIDC claims for the authenticated user.
(ctx context.Context)
| 882 | |
| 883 | // UserOIDCClaims returns the merged OIDC claims for the authenticated user. |
| 884 | func (c *Client) UserOIDCClaims(ctx context.Context) (OIDCClaimsResponse, error) { |
| 885 | res, err := c.Request(ctx, http.MethodGet, "/api/v2/users/oidc-claims", nil) |
| 886 | if err != nil { |
| 887 | return OIDCClaimsResponse{}, err |
| 888 | } |
| 889 | defer res.Body.Close() |
| 890 | if res.StatusCode != http.StatusOK { |
| 891 | return OIDCClaimsResponse{}, ReadBodyAsError(res) |
| 892 | } |
| 893 | var resp OIDCClaimsResponse |
| 894 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 895 | } |
| 896 | |
| 897 | // LoginWithPassword creates a session token authenticating with an email and password. |
| 898 | // Call `SetSessionToken()` to apply the newly acquired token to the client. |