MCPcopy Index your code
hub / github.com/coder/coder / UserOIDCClaims

Method UserOIDCClaims

codersdk/users.go:884–895  ·  view source on GitHub ↗

UserOIDCClaims returns the merged OIDC claims for the authenticated user.

(ctx context.Context)

Source from the content-addressed store, hash-verified

882
883// UserOIDCClaims returns the merged OIDC claims for the authenticated user.
884func (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.

Callers 2

userOIDCClaimsMethod · 0.80
TestUserOIDCClaimsFunction · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 1

TestUserOIDCClaimsFunction · 0.64