FoxIDs ontwikkeling / codebijdrage
Je kunt FoxIDs lokaal uitvoeren in Visual Studio op je ontwikkelmachine.
Clone de FoxIDs GitHub repository en maak eventueel pull requests.
Solution beschrijving:
- FoxIDs is de FoxIDs Identity Service ASP.NET Core applicatie
Lokale endpointhttps://localhost:44330 - FoxIDs.Control is de FoxIDs Control ASP.NET Core API en host van de FoxIDs Control Client Blazor WebAssembly
Lokale endpointhttps://localhost:44331
Lokale API endpointhttps://localhost:44331/api/
API Swagger (OpenApi) endpointhttps://localhost:44331/api/swagger/v2/swagger.json - FoxIDs.ControlClient is de FoxIDs Control Client Blazor WebAssembly
- FoxIDs.ControlShared is een bibliotheek die gedeeld wordt tussen de FoxIDs Control API backend en de FoxIDs Control Client Blazor WebAssembly frontend
- FoxIDs.Shared is een bibliotheek die gedeeld wordt tussen de FoxIDs ASP.NET Core applicatie en de FoxIDs Control ASP.NET Core API
- FoxIDs.SharedBase is een bibliotheek die door alle wordt gedeeld
Open de FoxIDs solution in Visual Studio of in je favoriete developer tool.
De solution is standaard geconfigureerd om lokaal te draaien en een file store te gebruiken voor zowel data als cache. De bestanden worden standaard opgeslagen in de data map in de root van de solution map.
Het standaard configuratiebestand appsettings.json in het FoxIDs project:
{
...
"Settings": {
"FoxIDsEndpoint": "https://localhost:44330",
"Options": {
"Log": "Stdout",
"DataStorage": "File",
"KeyStorage": "None",
"Cache": "File",
"DataCache": "None"
}
}
}
Het standaard configuratiebestand appsettings.json in het FoxIDs.Control project:
{
...
"Settings": {
"FoxIDsEndpoint": "https://localhost:44330",
"FoxIDsControlEndpoint": "https://localhost:44331",
"Options": {
"Log": "Stdout",
"DataStorage": "File",
"KeyStorage": "None",
"Cache": "File",
"DataCache": "None"
}
}
}
Klik run! De FoxIDs Control site zou in een browser moeten starten.
Log in met de standaard admin gebruiker admin@foxids.com met wachtwoord FirstAccess!
Na succesvolle login heb je toegang tot de master tenant. Je moet daarna een dev tenant aanmaken waar je applicaties (applicatieregistratie), API's (applicatieregistratie), gebruiker login (authenticatiemethode) en externe trust (authenticatiemethode) kunt toevoegen.
Nadat je dev tenant is aangemaakt kun je de get started gids volgen.
API client proxy
Het is mogelijk om op verschillende manieren te integreren met de FoxIDs Control API, het is gewoon een API die een interface beschrijving met Swagger (OpenApi) blootlegt.
Het is bijvoorbeeld mogelijk om client code te genereren met NSwag:
- Genereer code met de Visual Studio extension https://github.com/dmitry-pavlov/api-client-generation-tools.
- Genereer code met NSwagStudio https://github.com/RicoSuter/NSwag/wiki/NSwagStudio. Microsoft beschrijving https://docs.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-nswag?view=aspnetcore-2.2&tabs=visual-studio#generate-code-with-nswagstudio.
- Automatisch genereren van API clients tijdens build met NSwag https://blog.sanderaernouts.com/autogenerate-api-client-with-nswag
Je kunt een code voorbeeld vinden in FoxIDs.SampleSeedTool die automatisch een API client genereert tijdens build. Wanneer GenerateCode true is in het projectbestand.