CodeMash Membership service provides many operations for user management like user authentication and authorization.
Membership service is enabled automatically when you create a project. This means you can start using membership services and API methods right after you create a project.
Features included in membership service:
Users - users of your application.
Authentication and authorization - managing user session and permissions.
Using SDK
If you decide to use one of our provided SDK, the following code shows how to initialize membership service.
var projectId =Guid.Parse("{YOUR_PROJECT_ID}");var apiKey ="{YOUR_SECRET_KEY}";var client =newCodeMashClient(apiKey, projectId);var membershipService =newCodeMashMembershipService(client);
Example
The following are examples of membership SDK using different languages and frameworks.
usingSystem;usingCodeMash.Client;usingCodeMash.Membership.Services;usingIsidos.CodeMash.ServiceContracts;namespaceConsoleApplication{classProgram {staticvoidMain(string[] args) { // 1. Get your Project ID and Secret Keyvar projectId =Guid.Parse("{YOUR_PROJECT_ID}");var apiKey ="{YOUR_SECRET_KEY}"; // 2. Create a general client for API callsvar client =newCodeMashClient(apiKey, projectId); // 3. Create a service objectvar membershipService =newCodeMashMembershipService(client); // 4. Call an API methodmembershipService.RegisterUser(newRegisterUserRequest { Email ="test@email.com", Password ="password123" }); } }}