MCPcopy
hub / github.com/ory/kratos / get

Method get

identity/handler.go:381–406  ·  view source on GitHub ↗

swagger:route GET /admin/identities/{id} identity getIdentity # Get an Identity Return an [identity](https://www.ory.sh/docs/kratos/concepts/identity-user-model) by its ID. You can optionally include credentials (e.g. social sign in connections) in the response by using the `include_credential` qu

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

379// Extensions:
380// x-ory-ratelimit-bucket: kratos-admin-low
381func (h *Handler) get(w http.ResponseWriter, r *http.Request) {
382 i, err := h.r.PrivilegedIdentityPool().GetIdentityConfidential(r.Context(), x.ParseUUID(r.PathValue("id")))
383 if err != nil {
384 h.r.Writer().WriteError(w, r, err)
385 return
386 }
387
388 includeCredentials := r.URL.Query()["include_credential"]
389 var declassify []CredentialsType
390 for _, v := range includeCredentials {
391 tc, ok := ParseCredentialsType(v)
392 if ok {
393 declassify = append(declassify, tc)
394 } else {
395 h.r.Writer().WriteError(w, r, errors.WithStack(herodot.ErrBadRequest.WithReasonf("Invalid value `%s` for parameter `include_credential`.", declassify)))
396 return
397 }
398 }
399
400 emit, err := i.WithDeclassifiedCredentials(r.Context(), h.r, declassify)
401 if err != nil {
402 h.r.Writer().WriteError(w, r, err)
403 return
404 }
405 h.r.Writer().Write(w, r, WithCredentialsAndAdminMetadataInJSON(*emit))
406}
407
408// swagger:route GET /admin/identities/by/external/{externalID} identity getIdentityByExternalID
409//

Callers 15

__oryWebAuthnLoginFunction · 0.45
__oryPasskeyLoginFunction · 0.45
proxyFunction · 0.45
errors.spec.tsFile · 0.45
success.spec.tsFile · 0.45
ui.spec.tsFile · 0.45
errors.spec.tsFile · 0.45
success.spec.tsFile · 0.45
ui.spec.tsFile · 0.45
success.spec.tsFile · 0.45
error.spec.tsFile · 0.45

Calls 8

ParseUUIDFunction · 0.92
ParseCredentialsTypeFunction · 0.85
WriterMethod · 0.65
WriteMethod · 0.45

Tested by 10

hydraReauthFailsFunction · 0.36
expectSettingsOkFunction · 0.36
odicLoginFunction · 0.36
doConsentFunction · 0.36
fakeOidcFlowFunction · 0.36
signupMobilePasskeyFunction · 0.36
logoutMobileFunction · 0.36
doRecoveryFunction · 0.36
signupFunction · 0.36
signupFunction · 0.36