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)
| 379 | // Extensions: |
| 380 | // x-ory-ratelimit-bucket: kratos-admin-low |
| 381 | func (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 | // |