About my blog

I write about the technical and non-technical aspects of software development

How it works

Microsoft ASP.NETASP.Net
BlogEngine.NET BlogEngine.NET
Azure DevOpsAzure DevOps

Contact info

 Email
 Contact

Follow me

Prod-20240407.1

Categories

Posts in the 'Javascript' category

Building an Angular app with MSAL and RxJs
Building an Angular app with MSAL and RxJs

In this post I describe step-by-step, the design and implementation of an Angularx + MSAL + NgRx application that authenticates a user with Microsoft Identity in a Single Page Application.

Authenticating Angular with MSAL and NgRx
Authenticating Angular with MSAL and NgRx

I continue my recent theme of securing applications with Microsoft Identity and OAuth2 in this article. This time I move on to the front-end, from which we need to interact with a secured Web API.

platformBrowserDynamic with Angular Universal
platformBrowserDynamic with Angular Universal

Using platformBrowserDynamic with Angular Universal is a bit of a hack. All we are doing is providing configuration to the application server module so that it has configuration server-side before platformBrowserDynamic can load it on the client.

Angular platformBrowserDynamic method
Angular platformBrowserDynamic method

Scenarios where configuration will be injected only into services and components work well with the APP_INITIALIZER technique. If however we need to configure an application consisting of multiple modules, with each requiring configuration, even partial configuration, then an alternative is necessary.

Angular Universal with APP_INITIALIZER
Angular Universal with APP_INITIALIZER

The APP_INITIALIZER token in Angular can also be used to delay the bootstrapping of the application for Angular Universal

Angular [Universal] runtime configuration
Angular [Universal] runtime configuration

Although the standard out-of-the-box Angular application makes it easy to create and configure options for your application using 'environment' files, this approach has a few issues

Data capture
Data capture

One of the most common requirements of a software application is to get users to enter data.
This could be a survey, an online form for a loan application, the need to complete a profile or purchase, or simply to login or verify identity.