Skip to content

Configuration

Custom Identity user

Aufy come with a default user model AufyUser. If you want to use custom user model, you can inherit from AufyUser and add your own properties.

MyUser.cs
public class MyUser : AufyUser
{
public string MyProperty { get; set; }
}

Custom api path

By default, Aufy endpoints are available under api/auth for authentication and api/account for account management. You can change it by configuring AuthApiBasePath and AccountApiBasePath properties in AufyOptions. The best option to do it is to add an optional parameter to AddAufy function

Program.cs
builder.Services
.AddAufy<AufyUser>(builder.Configuration, options =>
{
options.AccountApiBasePath = "/my-account";
options.AuthApiBasePath = "/my-auth";
})
...

Default User Role

By default, Aufy creates a new user without any roles. You can change it by configuring DefaultRoles property in AufyOptions.

Program.cs
builder.Services
.AddAufy<AufyUser>(builder.Configuration, options =>
{
options.DefaultRoles = new[] { "MyRole" };
})
...