AuthN | C# SDK | User Endpoints
User Endpoints
Get User (client token)
Client.Userinfo(string)Retrieve the logged in user's token and information.
var response = await client.Client.Userinfo("pmc_d6chl6qulpn3it34oerwm3cqwsjd6dxw");
Change a user's password
ClientPassword.Change(string, string, string)Change a user's password given the current password.
var response = await client.Client.Password.Change(
"ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
"hunter2",
"My2n+Password");
Create User
User.Create(UserCreateRequest)Create a user.
Profile profile = new Profile();
profile.FirstName = "Joe";
profile.LastName = "User";
var request = new UserCreateRequest
.Builder("joe.user@pangea.cloud", profile)
.Build();
var response = await client.User.Create(request);
Delete User - Email
User.DeleteByEmail(string)Delete a user by email address.
await client.User.DeleteByEmail("joe.user@pangea.cloud");
Delete User - ID
User.DeleteByID(string)Delete a user by ID.
await client.User.DeleteByID("pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5");
Update user's settings
User.Update(UserUpdateRequest)Update user's settings.
var request = new UserUpdateRequest
.Builder()
.WithEmail("joe.user@pangea.cloud")
.WithDisabled(true)
.Build();
var response = await client.User.Update(request);
List Users
User.List(UserListRequest)Look up users by scopes.
var request = new UserListRequest.Builder().Build();
var response = await client.User.List(request);
Delete user authenticator
UserAuthenticators.Delete(UserAuthenticatorsDeleteRequest)Delete user authenticator.
var request = new UserAuthenticatorsDeleteRequest
.Builder("pau_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a")
.WithID("pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5")
.Build();
await client.User.Authenticators.Delete(request);
Get user authenticators
UserAuthenticators.List(UserAuthenticatorsListRequest)Get user authenticators.
var request = new UserAuthenticatorsListRequest
.Builder()
.WithID("pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5")
.Build();
var response = await client.User.Authenticators.List(request);
Get user - email
UserProfile.GetByEmail(string)Get user's information by email.
var response = await client.User.Profile.GetByEmail("joe.user@pangea.cloud");
Get user - id
UserProfile.GetByID(string)Get user's information by id.
var response = await client.User.Profile.GetByID("pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5");
Update user
UserProfile.Update(UserProfileUpdateRequest)Update user's information by identity or email.
Profile updatedProfile = new Profile()
{
{ "country", "Argentina" }
};
var request = new UserProfileUpdateRequest
.Builder(updatedProfile)
.WithID("pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5")
.Build();
var response = await client.User.Profile.Update(request);