This project is licensed under the MIT License. See the LICENSE file for details.
Below are detailed explanations and instructions for each section of the documentation.
The Stellar .NET Identity Platform Template is designed to help developers quickly set up an ASP.NET Core application with integrated Stellar account management and advanced authentication features.
Key features include:
- Passwordless Authentication: Users can register and log in using their Stellar accounts via the Freighter wallet extension.
- Multi-Factor Authentication: Enhance security with MFA using authenticator apps.
- Secure Keypair Management: Generate, encrypt, and manage Stellar keypairs within the application.
Ensure that your development environment meets the necessary requirements.
-
.NET SDK
- Download from Microsoft .NET Downloads.
-
Visual Studio 2022
-
Download from Visual Studio Downloads.
-
Alternatively, use Visual Studio Code with the C# extension.
-
-
Node.js
- Download from Node.js Downloads.
-
Git
- Download from Git Downloads.
-
Freighter Wallet Extension
- Install from Freighter Website.
-
Authenticator App
- Install Microsoft Authenticator or Google Authenticator on your mobile device.
Clone the repository to your local machine:
git clone https://github.com/lockb0x-llc/Stellar-DotNet-Identity-Framework.git
-
Navigate to the Project Directory
cd Stellar-DotNet-Identity-Framework
-
Restore NuGet Packages
dotnet restore
-
Install Front-End Dependencies
If applicable:
npm install
-
Build the Project
dotnet build
-
Apply Database Migrations
dotnet ef database update
Edit appsettings.json
and configure the necessary settings.
Provide your database connection string:
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=YourDatabaseName;Trusted_Connection=True;MultipleActiveResultSets=true"
}
Set the Stellar network:
"Stellar": {
"Network": "TestNet",
"HorizonUrl": "https://horizon-testnet.stellar.org"
}
- Use
"PublicNet"
andhttps://horizon.stellar.org
for the production network.
If you prefer a different database provider (e.g., PostgreSQL, MySQL), update the ApplicationDbContext
configuration in Startup.cs
or Program.cs
.
Include the Freighter API in your HTML pages:
<script src="https://www.freighter.app/freighter-api.js"></script>
- Registration: Users connect their Freighter wallet to register.
- Login: Users authenticate by signing a challenge message.
Note: Ensure your client-side scripts handle Freighter API interactions and error handling.
Configure Identity options to enable MFA:
options.SignIn.RequireConfirmedAccount = true;
options.Tokens.AuthenticatorTokenProvider = TokenOptions.DefaultAuthenticatorProvider;
- Enable MFA Page: Users can enable MFA in their account settings.
- Verification During Sensitive Actions: Require MFA verification when revealing secret keys or changing account settings.
Users can generate new Stellar keypairs within the application.
- Encryption: Private keys are encrypted using a passphrase provided by the user.
- Storage: Encrypted private keys are stored securely in the database.
- Viewing Keypairs: Users can see a list of their keypairs with labels and public keys.
- Revealing Secret Keys: MFA verification is required to reveal the secret key.
- Adding Keypairs: Users can add additional keypairs as needed.
To run the application locally:
-
Start the Application
dotnet run
-
Access the Application
- Open your browser and navigate to
https://localhost:5001
.
- Open your browser and navigate to
Note: If you encounter issues with HTTPS, ensure that your development certificates are set up correctly.
-
Update Configuration
- Set the
ASPNETCORE_ENVIRONMENT
variable toProduction
. - Update
appsettings.Production.json
with production settings.
- Set the
-
Database Migration
- Apply migrations to the production database.
- Azure App Service
- AWS Elastic Beanstalk
- Docker Containers
Refer to the respective cloud provider's documentation for detailed deployment instructions.
-
Ensure Freighter is Installed
- Verify that the Freighter extension is installed and enabled.
-
HTTPS Requirement
- Freighter requires the site to be served over HTTPS.
-
Invalid Signatures
- Check that the correct network (TestNet or PublicNet) is configured.
- Ensure the challenge messages are consistent between client and server.
-
Connection Issues
- Confirm that the database server is accessible.
- Verify the connection string is correct.
We welcome contributions from the community!
-
Reporting Issues
- Use the GitHub Issues tab to report bugs or request features.
-
Submitting Pull Requests
- Fork the repository.
- Create a new branch for your feature or fix.
- Submit a pull request with a detailed description.
This project is licensed under the MIT License.
License Summary:
- Commercial Use: Permitted
- Modification: Permitted
- Distribution: Permitted
- Private Use: Permitted
- Liability: The software is provided "as is", without warranty of any kind.
For assistance, please contact:
- Email: [email protected]
- GitHub Issues: Create an Issue
Yes, you can extend the template to include other authentication providers like Google, Facebook, or Microsoft by adding the necessary packages and configuration.
Private keys are encrypted using a passphrase provided by the user and stored in the database. They can only be decrypted by providing the correct passphrase.
While the template includes security features, you should perform a thorough security review and make necessary adjustments before deploying to production.
-
Stellar Development Foundation
-
Freighter Wallet
-
Microsoft Identity Platform
This documentation should provide developers with the information they need to get started with your Stellar .NET Identity Platform template. Feel free to adjust and expand upon this template to suit your project's specific features and requirements.
If you have any further questions or need additional assistance with any section, please let me know!