<@U04UQ68083H> I am using .NET SDK and self-hosted...
# ory-copilot
b
@chilly-king-10285 I am using .NET SDK and self-hosted Kratos and I am trying to create an identity. From request I get email and passowrd and my problem is that identity is created, however the method returns null instead of the created identity as written in documentation. Can you help me where could be the problem? Here is the code: "Configuration config = new Configuration(); config.BasePath = "http://127.0.0.1:4434/"; var apiInstance = new FrontendApi(config); var identityApi = new IdentityApi(config); var credentials = new KratosIdentityWithCredentials(password: new KratosIdentityWithCredentialsPassword(config: new KratosIdentityWithCredentialsPasswordConfig(password: request.Password))); UserTraits traitsObject = new() { email = request.Email }; var verifiableAdresses = new List<KratosVerifiableIdentityAddress> { verifiableIdentityAddress }; var kratosCreateIdentityBody = new KratosCreateIdentityBody(schemaId: "default", traits: traitsObject, credentials: credentials); KratosIdentity result = identityApi.CreateIdentity(kratosCreateIdentityBody);"
c
A message from kapa.ai
I'm sorry, but the knowledge sources provided do not contain information about the .NET SDK or the specific issue you're encountering with the
CreateIdentity
method returning null. The sources mostly cover the Ory Kratos API reference and how to manage identities using JSON schemas. However, it's important to note that when creating an identity, you can change the
schema_id
to reflect the schema you want to use for this identity. The trait key/values depend on your schema as well. The command shown in the sources does not create a password or any other type of credential for the identity. This might be something to consider in your .NET implementation. For authentication, the sources mention that you must be authenticated by means of an
oryAccessToken
. For more specific help with your issue, I would recommend checking the official Ory Kratos .NET SDK documentation or reaching out to the Ory community for support.
b
@chilly-king-10285 can I create an API key in self-hosted Kratos? If yes, how?
c
A message from kapa.ai
I'm sorry, but the knowledge sources provided do not contain information about creating an API key in a self-hosted Kratos instance. The sources mostly cover the Ory Kratos API reference and how to manage identities using JSON schemas, but they do not mention the creation of API keys. For more specific help with your issue, I would recommend checking the official Ory Kratos documentation or reaching out to the Ory community for support.