Browsed by
Author: Kenneth Holter

Sharepoint Online: Custom web part that display news only from followed sites

Sharepoint Online: Custom web part that display news only from followed sites

At work we rolling out our new Intranet based on Sharepoint Online. While the news web part shipped with the platform works pretty well, we found that we had some requirements that combined didn’t make is a good fit: All news should be available to logged in user News are aggregated from intranet related sites the users follow Users can not opt out from receiving news from their own department With these requirements in mind, we decided to implement our…

Read More Read More

Next.js: Cannot read property of undefined

Next.js: Cannot read property of undefined

I had a bug in my Next.js app, in which the props passed to my component unexpectedly was undefined. Duckduckgo’ing the issue didn’t result in any resolution, as my particular mistake was a self introduced bug. Just in case others makes the same mistake as I did, here’s a quick write-up. Consider this /pages/blog.tsx file: When executing the above code, I got this type of error message: “TypeError: Cannot read property ‘posts’ of undefined“. Many Next.js developers may have spotted…

Read More Read More

SharePoint Online hub sites namespace and structure

SharePoint Online hub sites namespace and structure

For my company’s upcoming intranet based on SharePoint Online (SPO), we’ve looked into ways to organize our sites. As I haven’t found much online information on the subject, I though I’d share a couple of points here. Namespacing First, let’s discuss namespacing. We’ve had SPO around for a long time, long before we got around to manage it properly, so we have numerous sites with vastly different URLs and contents. As our intranet will consist of just a subset of…

Read More Read More

Storing valid, sanitised HTML in database to mitigate malicious code injection

Storing valid, sanitised HTML in database to mitigate malicious code injection

In a typical cross-site scripting (XSS) attack, the hacker submit a HTML form which include malicious code. When another user visit the page in which this data is rendered, the malicious code is executed. There are at least a couple of ways to mitigate this risk: When the hacker submit the HTML form, any malicious code is removed before storing the data in the database When retrieving data from the database, removing any malicious code before rendering it on the…

Read More Read More

Custom CSS on SharePoint Online sites

Custom CSS on SharePoint Online sites

We’ll be using SharePoint Online as platform for our upcoming intranet. As Microsoft currently doesn’t support much visual tweaking, we were looking to apply our own CSS to the intranet related SPO sites. Applying Custom CSS is not supported, so we were looking for a workaround until Microsoft hopefully does enable this in the future. Although not supported, and likely not even recommended, we got our custom CSS up and running by creating an application customizer, based on the official…

Read More Read More

Updating Jenkins CI behind corporate firewall

Updating Jenkins CI behind corporate firewall

Our Jenkins CI server (https://jenkins.company.com) doesn’t have access to Internet (neither directly nor through a proxy), yet we need to update both Jenkins itself as well as the Jenkins plugins. We’ve set up another of our servers, https://jenkins-repo.company.com, as a Jenkins mirror site, which on a regular basis runs this command in a cron job: The /srv/mirrors/jenkins folder is hosted by Nginx. As the rsync’ed files contain references to https://updates.jenkins.io, Jenkins will try and contact https://updates.jenkins.io when downloading the updated…

Read More Read More

REST API entry points to a message based, event driven architecture

REST API entry points to a message based, event driven architecture

A while back I started working at an IT department that didn’t really have much in-house development, and thus didn’t have any integration architecture defined. I set out to look into our business needs along with potential architectures. I’d been a great fan of message based, event driven architecture, and found that to be a good fit for our needs. One of my first projects was quite simple – the user would visit one of our internal websites and submit…

Read More Read More

Using AWS Cognito to authorize access to API Gateway

Using AWS Cognito to authorize access to API Gateway

I’m writing a simple web application that at the moment basically does this: In the web app, users log in The web app contacts AWS Cognito for user authentication. In AWS Cognito, I’ve set up a user pool, think of it as a database, in which my users are stored. When a user sign in, AWS Cognito checks the user pool to verify the password. AWS Cognitor responds with different JWT tokens, including an ID token for the user The…

Read More Read More

Setting up Visual Studio for developing SharePoint online site provisioning software

Setting up Visual Studio for developing SharePoint online site provisioning software

We’re in the process of setting up SharePoint Online as our Intranet platform, and are looking to automate site creation using something like Azure Functions. Currently, I’m developing the business logic for creating the new sites, including setting the correct permissions, theme, links and so forth. I’m using Visual Studio for this project. I’m new to both SharePoint Online as .NET, and as tutorials on setting up Visual Studio with regards to SharePoint Online provisioning seems to be lacking, I…

Read More Read More

Modifying cn=config in OpenLDAP without rootDN password

Modifying cn=config in OpenLDAP without rootDN password

Using a configures “admin” user and the corresponding password, I successfully created a bind user uid=bind_user,ou=users,dc=work,dc=com on an OpenLDAP server. The bind user needed escalated privileges, but as the cn=admin,dc=work,dc=com user didn’t have write access to the cn=config database, all my efforts running commands such as ldapmodify on the bind user, resulted in this error message: I didn’t have access to the rootDN password, so I was kind of stuck for a while. Then I was advised to try ldapvi,…

Read More Read More