Silent Renew and the "login_required" Error When Using oidc-client

I recently implemented the Silent Renew functionality of oidc-client in an Angular application I work on, and was getting reports that the users' tokens were still expiring. This made no sense to me as I'd verified the code was working during development, but yesterday I found the problem and am hoping it will save someone some time.

The error we were getting back was "Error from signinSilent: login_required". This indicates that the user's session is no longer active on IdentityServer and they must re-authenticate -- which, of course, is what we're trying to prevent by using Silent Renew. In our case, the problem wasn't with the Silent Renew functionality, but rather the user's session was expired. The reason why it was expired was because, for some reason, we were setting the session length to 15 minutes instead of the default 10 hours.

What was occurring was that Silent Renew was attempting to renew a token after 55 minutes (60 minutes expiration, …

Serving Your Angular CLI Apps Locally Over HTTPS

When running an Angular CLI app locally, it's easy to set it up to run over HTTPS to more accurately match how it would run in a secure production environment (rather than just running it over HTTP locally). The below approach works with Angular CLI 6 and above, but may also be available in earlier versions.

In your angular.json file, look for your project in the projects node and then find the serve child node. Under that node, you can add a property called ssl and set the value to true to cause Angular CLI to build the project with a local SSL cert that it will create for you.

"serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { "browserTarget": "staff-portal-two:build", "ssl": true },
When you run ng serve for the first time after adding this property, there will be some output on the command line regarding the certificate being created. After awhile, it will also remove and r…

Setting Up Your Angular CLI App to Generate Code Coverage Reports Any Time Tests Are Run in a Workspace with Multiple Projects

I currently do development in an Angular CLI application that contains multiple library projects, and recently enabled code coverage reports to be generated automatically every time unit tests were run. This consisted of 4 steps:

Turn on code coverage for each project.Exclude the libraries from coverage in projects that utilized them (each library has its own coverage).Set the output directory for each project's code coverage report to a sub-directory of the code coverage directory to avoid overwriting files for each report generated.Make additions to ignore the code coverage directory from source control. Here's each of these steps in detail.
Step 1: Turn on code coverage for each project In angular.json, go to the architect/test/options node for each project and add a property called codeCoverage if it's not already there. Set the value to true, as shown below:
"test": { "builder": "@angular-devkit/build-angular:karma", "options":…

How to Set Who Gets Notified When a Data Extension Import Occurs in Marketing Cloud

Some time ago, I created a data extension in Marketing Cloud and somehow set up a way to get an email notification when one of our scheduled processes kicked of an import. But recently, for the life of me, I couldn't figure out how I set up the import notification part, and I was unable to find the setting in the Marketing Cloud UI. Finally, with a little Googling, and by narrowing down what I was searching by, I found it.

Here's how you can set the email address to have the Data Extension Import Notification sent to.  Hopefully this can help someone else in the same situation.

1. From the main Marekting Cloud dashboard, select Contact Builder under the Audience Builder menu. (While I had been trying to figure all of this out I had been looking at the Data Extension configuration, and then tried looking for the Import Definition -- I couldn't image it would be under the Contact Builder section.)
2. Select Imports from the top nav bar.
3. Find the import definition in the g…

How To Set Up Extra Application Initialization in an Angular App

Angular includes a constant called APP_INTIALIZER. As of the time of this writing, the Angular docs page on it looks like this:

I'm pretty sure they've updated the page since the first time I looked at it, at which point it said even less than what is shown above. And even the expanded documentation above isn't exactly clear as to how to use this. So I'll elaborate.

In your app's module file, you can declare a provider that provides APP_INITIALIZER. And you can tell it to use a certain function via the useFactory property.

For example, in my app.module.ts, I import my environment constant which contains environment-specifc config settings, and I've declared a function called initializeApp() which initializes my AppConfigService with envrionment:

import { environment } from'../environments/environment';
exportfunctioninitializeApp(appConfigSvc: AppConfigService) { return () => { appConfigSvc.init(environment); } }
Then, when I used @NgModule()

Getting Moment.js to Work with Angular 6 and Higher

One of the reasons I blog here is so that I'll have an easy way to find things I needed to figure out, so that I don't need to figure them out again. And I really do need to keep that in mind. Today, a co-worker of mine asked me for help getting Moment.js to work with an application using Angular 7. Before I could find a solution, he found one already in the code in a different area.

When I looked at the file in question, I'd written it (sigh). I didn't remember the problem (or the solution) until seeing the file again. At the time, I'd been trying to get Moment.js to work with Angular 6. Here's the simple solution:

//Moment doesn't want to behave in Angular 6. Here's the workaround. import * as moment_ from'moment'; const moment = moment_;
And then you just the use moment constant like this:

payload.birthDate = moment(profile.birthDate).toDate();
I think I probably found this solution on Stack Oveflow, so I can't really take credit for…

I Love The Cheesy Hallmark Channel Christmas Movies

(Updated 12/2/2018)

I have a soft spot for TV, movies, and music that are considered...let’s say less than the best. Sometimes entertainment that is unintentionally bad is more enjoyable to me than something comparatively decent. And the Hallmark Channel Christmas movies fit that bill for me.

Are they bad? Well, not really. But they’re incredibly cheesy (IMHO). I watched them every chance I had during last Christmas season, and this year I plan to do the same. Here are the reasons I find these movies so cheesy, and why I love them so much.
They’re essentially Lifetime movies - Okay, now stay with me here. There’s nothing wrong with Lifetime movies, and I don't want to give you the wrong impression. It's just that these movies follow the same general formula: the lead character is female (either a professional or a small business owner), the story deals with romantic relationships, and the male lead is unrealistically perfect and the type of guy that makes us real-life guys look…