### launchSettings.json Configuration Source: https://github.com/packtpublishing/.net-maui-cookbook.git/blob/main/Chapter05/c5-AuthenticationServiceAndClient/Readme.md Example configuration from launchSettings.json specifying the server's HTTPS port. ```json { "profiles": { "https": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", "applicationUrl": "https://localhost:7158;http://localhost:5158", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } } } ``` -------------------------------- ### Install Dev Tunnel CLI (Windows) Source: https://github.com/packtpublishing/.net-maui-cookbook.git/blob/main/Chapter05/c5-AuthenticationServiceAndClient/Readme.md Installs the Dev Tunnel command-line interface on Windows using the Windows Package Manager. ```shell winget install Microsoft.devtunnel ``` -------------------------------- ### Install Dev Tunnel CLI (macOS) Source: https://github.com/packtpublishing/.net-maui-cookbook.git/blob/main/Chapter05/c5-AuthenticationServiceAndClient/Readme.md Installs the Dev Tunnel command-line interface on macOS using Homebrew. ```shell brew install --cask devtunnel ``` -------------------------------- ### Run .NET MAUI Server Source: https://github.com/packtpublishing/.net-maui-cookbook.git/blob/main/Chapter05/c5-AuthenticationServiceAndClient/Readme.md Starts the .NET MAUI server application using the 'https' launch profile. ```shell dotnet run --launch-profile https ``` -------------------------------- ### Signing in with a Google Account Source: https://github.com/packtpublishing/.net-maui-cookbook.git/blob/main/README.md Guides on integrating Google Sign-In for authentication in .NET MAUI applications, typically involving OAuth 2.0 flows and platform-specific configurations. ```C# // Requires setup with Google Cloud Console and platform-specific configurations // Example using a library like IdentityModel.OidcClient var authenticator = new PublicClientApplication("YOUR_GOOGLE_CLIENT_ID"); var result = await authenticator.AcquireTokenInteractive(new[] { "profile", "email" }).ExecuteAsync(); // Use result.AccessToken to authenticate with your backend ``` -------------------------------- ### OpenAI API Key Setup Source: https://github.com/packtpublishing/.net-maui-cookbook.git/blob/main/Chapter06/c6-OpenAITextAssistant/Readme.md Instructions on obtaining and setting up your OpenAI API key within the .NET MAUI application. Replace the placeholder string with your actual API key. ```csharp In the [MainViewModel](/Chapter06/c6-OpenAITextAssistant/c6-OpenAITextAssistant/MainViewModel.cs) class, replace the *[Your API Key](/Chapter06/c6-OpenAITextAssistant/c6-OpenAITextAssistant/MainViewModel.cs#L13C61-L13C73)* string with your OpenAI key. ``` -------------------------------- ### Building a Chat Bot with Ollama Deployed to a Self-Hosted Server Source: https://github.com/packtpublishing/.net-maui-cookbook.git/blob/main/README.md Guides on creating a .NET MAUI chat interface that communicates with an Ollama instance running on a local or remote server for AI-powered conversations. ```C# using HttpClient; var client = new HttpClient(); var requestBody = new { prompt = "User: Hello!", model = "llama2" }; var response = await client.PostAsJsonAsync("http://localhost:11434/api/generate", requestBody); // Process response.Content ``` -------------------------------- ### Host Dev Tunnel Source: https://github.com/packtpublishing/.net-maui-cookbook.git/blob/main/Chapter05/c5-AuthenticationServiceAndClient/Readme.md Starts hosting the configured Dev Tunnel, making the service accessible externally. Provides URLs for browser access and inspection. ```shell devtunnel host mytunnel ``` -------------------------------- ### Creating an Authentication Service with ASP.NET Core Identity Source: https://github.com/packtpublishing/.net-maui-cookbook.git/blob/main/README.md Details the setup of an ASP.NET Core Web API project using Identity for user authentication and authorization. ```C# // Startup.cs or Program.cs builder.Services.AddIdentity() .AddEntityFrameworkStores() .AddDefaultTokenProviders(); builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(options => { // Configure JWT options }); ``` -------------------------------- ### Creating Motion Graphics with Lottie Animations Source: https://github.com/packtpublishing/.net-maui-cookbook.git/blob/main/README.md Guides on integrating Lottie animations into .NET MAUI applications for smooth, vector-based motion graphics. Requires a third-party library. ```XAML ``` -------------------------------- ### Running the Authentication Service Source: https://github.com/packtpublishing/.net-maui-cookbook.git/blob/main/Chapter05/c5-AuthenticationService/Readme.md Provides instructions on how to run the ASP.NET Core authentication service project. It covers both Visual Studio and VS Code environments, including the necessary commands to start the server and access the Swagger UI. ```bash cd c5-AuthenticationService dotnet run --launch-profile https ``` -------------------------------- ### Implementing a Custom Arranging Algorithm in .NET MAUI Source: https://github.com/packtpublishing/.net-maui-cookbook.git/blob/main/README.md Guides on creating custom layout containers in .NET MAUI by inheriting from Layout and implementing a custom arranging algorithm. This allows for unique layout behaviors. ```C# public class CustomLayout : Layout { protected override Size ArrangeChildren(Rect bounds) { // Custom arrangement logic here return bounds.Size; } } ``` -------------------------------- ### Running Web API Server (VS Code) Source: https://github.com/packtpublishing/.net-maui-cookbook.git/blob/main/Chapter04/c4-WebApiComplete/Readme.md Starts the Web API server using the 'https' profile in VS Code. The server typically runs on port 7197. ```bash cd c4-WebApiServer dotnet run --launch-profile https ``` -------------------------------- ### Implementing Detail and Edit Forms Source: https://github.com/packtpublishing/.net-maui-cookbook.git/blob/main/README.md Guides on creating UI forms for displaying item details and editing existing data in .NET MAUI, often involving data binding to ViewModel properties. ```XAML