can we send extra data in .net8 identity endpoints
i need to send some extra data add the time of register. this register end point only allow email and password
12 Replies
You will have to create a new ApplicationUser entity that extends the IdentityUser. In this new ApplicationUser entity, you can add the properties or fields you want.
you means add other entity instead of IdentityUser
builder.Services.AddIdentityApiEndpoints<IdentityUser>()
You can try it and see if it works.
i dont change IdentityUser butt i add another property (username) in register request but its not update db wth this
It might be because the UserName is set internally. Try it with PhoneNumber and see if it updates.
i also try with phone number
its not updated
phoneNumbr is still null
Have you used your debugger to find out where the problem is coming from?
how can debug end point thats are injected witth
builder.Services.AddIdentityApiEndpoints<IdentityUser>()
If its injected, then I honestly don't know. I hope someone else can assist.
ok
You cannot customise the identity endpoints at all.
You will have to write your own register endpoint if you need additional information.
As far as I know you also cannot disable specific endpoints.
That means that the default endpoint will still exist and be operational.
If it's a problem, that people could register without that additional information, you probably need to drop the identity endpoints all together and write your own.