Welcome to the Synapsers.Oauth.Matterport repository! This project provides a robust OAuth integration for Matterport within ASP.NET Core and Blazor applications. This library offers secure and extensible methods for authenticating users with Matterport, supporting custom OAuth flows, ASP.NET Core Identity, and seamless token management.
The Synapsers.Oauth.Matterport library simplifies the process of integrating Matterport's OAuth services into your ASP.NET Core and Blazor applications. With this library, developers can easily authenticate users, manage tokens, and implement custom OAuth flows, all while maintaining security and extensibility.
To get started, check the Releases section for the latest version of the library. Download and execute the package to begin your integration journey.
- Secure Authentication: Ensure user data is protected with OAuth 2.0 standards.
- Extensible Architecture: Customize the library to fit your specific application needs.
- ASP.NET Core Identity Support: Integrate seamlessly with ASP.NET Core Identity for user management.
- Custom OAuth Flows: Implement your own OAuth flows to enhance user experience.
- Token Management: Handle access tokens and refresh tokens effortlessly.
To install the Synapsers.Oauth.Matterport library, you can use NuGet Package Manager. Run the following command in your terminal:
dotnet add package Synapsers.Oauth.Matterport
Alternatively, you can add the package via the NuGet Package Manager in Visual Studio.
- Configure Services: In your
Startup.cs
, add the following lines to configure the OAuth services:
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = "Matterport";
options.DefaultChallengeScheme = "Matterport";
})
.AddOAuth("Matterport", options =>
{
options.ClientId = Configuration["Matterport:ClientId"];
options.ClientSecret = Configuration["Matterport:ClientSecret"];
options.CallbackPath = new PathString("/signin-matterport");
options.AuthorizationEndpoint = "https://api.matterport.com/oauth/authorize";
options.TokenEndpoint = "https://api.matterport.com/oauth/token";
options.SaveTokens = true;
});
services.AddControllersWithViews();
}
- Add Authentication Middleware: In the
Configure
method, add the authentication middleware:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
- Create a Login Action: Create an action in your controller to initiate the login process:
public IActionResult Login()
{
var redirectUrl = Url.Action("LoginCallback", "Account");
var properties = new AuthenticationProperties { RedirectUri = redirectUrl };
return Challenge(properties, "Matterport");
}
- Handle Callback: Create a callback action to handle the response from Matterport:
public async Task<IActionResult> LoginCallback()
{
var result = await HttpContext.AuthenticateAsync("Matterport");
if (result.Succeeded)
{
// User is authenticated, handle login logic here
}
return RedirectToAction("Index", "Home");
}
For applications requiring custom OAuth flows, the library allows you to define your own endpoints and logic. You can extend the existing functionality by creating custom services or overriding default behaviors.
The library manages access tokens and refresh tokens automatically. You can access these tokens through the authentication properties after a successful login. This simplifies token handling, allowing you to focus on your application's core features.
The Synapsers.Oauth.Matterport library is compatible with:
- ASP.NET Core
- Blazor Server
- Blazor WebAssembly
This flexibility allows you to integrate Matterport's OAuth services into various types of applications seamlessly.
We welcome contributions to the Synapsers.Oauth.Matterport project. If you would like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with clear messages.
- Push your branch and create a pull request.
Your contributions help improve the library for everyone!
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or support, please reach out via the GitHub issues page or contact the repository owner directly.
Feel free to explore the Releases section for the latest updates and versions. We hope you find this library helpful in your development journey with Matterport!