- When setting up OpenID Connect with ASP.NET Core in a docker container environment, you may encounter issues with the public authority URL being not accessible inside of the container, causing the setup to fail.In my test case, it's a Sitecore 10.1 XP environment with Sitecore Identity. Internal Identity URL is http://id but the external Identity URL is https://identity.clientname.com.This is only one of the possible solutions.In summary, this solution is to hijack when requests are made in the application related to OpenID connect, and replace external authority URLs with internal ones.I am not covering the overall setup of OpenID connect in ASP.NET Core, there are enough articles about it on the internet already.Create a custom HttpClientHandler like below:In the startup.cs, replace the default BackchannelHttpHandler with the custom one:Replace the URLs, ideally, get them from configurations. Note that the handling of http vs https since internal is normally http and external is https.After the setup, all the requests inside of docker related to OpenID connect will use the internal URL and browser URLs will be proper public https versions.
- If you are not in the mood for a story, feel free to jump to the FastMail review section down below.Since I had my first Gmail account in 2006, over the years I have registered many more. Plus other Outlook and Office365 emails. I always wanted a centralised place online to access all the accounts but I never found a solution that I liked.Recently a Telegram bot became popular among online Chinese communities, it can query all the leaked personal data based on emails, website usernames, and mobile numbers etc. I have always known that things are being leaked online via various hacks but I never thought it is this serious.It had everything! My passwords, security questions, emails, mobile numbers, national identity number (of China) and rough locations I have surfed the internet over the years when I was in China.The conclusion I came to after that: to guarantee personal data security in this era
I have been using LastPass for a long time so the password part is solved already. When it comes to email, not so much.I have about 15 emails addresses currently with Gmail and Outlook/Office365. One of the Gmail accounts is still the free legacy GSuite plan and is bind to a custom domain of mine. The problem with that domain is that it is a .US domain that doesn't support privacy protection and has to expose my personal contact information in WHOIS databases.Therefore the plan was to
- For every service and website, different emails and passwords shall be used.
- Security questions should also be dynamically generated passwords that are stored in a password manager.
FastMail seems to be a good choice. After trialling it for less than a day, I select the Standard plan and started migrating all my email accounts and setup.Here are my takes:
- Get a new, not-too-long, cheap domain that supports WHOIS guard
- Switch to a PAID email service for the custom domains and manage all email accounts in one single place. Then gradually change all emails to the custom ones.
- Emails from 15 Gmail and Outlook/Office365 accounts were imported. Can not import iCloud emails, only contacts and calendars. The migration processes were smooth.
Using Other Emails in One Place
- IMAP and SMTP can be set up automatically when importing email accounts.
- IMAP default poll interval is 1 hour when the web interface is not open. It's a bit long. So I changed all email accounts to forwarding, this allows me to set up rules to mark them as read as well.
- IMAP settings can be disabled without deleting them.
- Note that if an email is marked as spam in the original email account, it won't be forwarded. Since normally spam are deleted in 30 days, there is a slight chance of losing important emails. Very slight...
- Since SMTP was set up during import, you still can send emails with those accounts.
- FastMail is not fast... It is not slow, but the web interface is sometimes stuck. iOS app seems to be an advanced web app so sometimes it loads for a while. That being said, it's not an issue. It's fast enough, just not lightning fast.
- I set up 2 custom domains. One of them has DNS servers set to FastMail's so the setup was really easy. And since they manage the DNS, it makes setup easier for other features too like sub-domains and websites etc...
Labels v.s. Folders
- This was a surprise to me since I didn't know they had this feature. Basically allows you to host static websites under your custom domains or your FastMail accounts. When DNS is managed by them as mentioned above, no CNAME setup is required at all. With just a few clicks, the website is up.
- Not much use for me at this point, but I am sure this would come in handy one day.
- You can choose to use Labels or Folders. I chose Labels since I like to mark emails with multiple labels and labels can be nested too so still support a tree structure.
- I used about 6GB for all emails. The Standard plan comes with 30GB, which should be enough for me for the next few decades...
Labelling wildcard emails use To address
- The setup on iPhone was just a scan of a QR code! It sets up email, calendar, contacts, notes and reminders altogether. So I can replace all the Google services on the phone which is great. However I couldn't find reminders from iOS on the web interface, so I disabled the feature on iPhone.
- Haven't tested other email clients yet but I guess they should all work fine?
Updates: Fastmail support actually helped me with the Sieve code that's required and it does exactly what I wanted!Search
- One of the main benefits of having a custom domain email for me is to be able to use any email address with that domain and all the emails go into one single mailbox. It is very handy so I can use different email addresses for different services/websites without any pre-setup required.It does create a challenge to identify which email is for which address when looking at the mailbox. So in Google, I built App Scripts to automatically label incoming emails with the email address from To address.FastMail doesn't support this out of the box. However, they do support the Sieve code and it seems to be powerful enough to do the things I wanted. The problem is that I have never heard of it before and am still figuring out how to write the script. I am also trying to get help from their Support for this. Anyway, this wouldn't be a big issue if it can't be done automatically. I can always manually set up the rules afterwards.
Couldn't figure out a way to search for emails without any labels assigned yet...Use "in:Archive" in search would give all emails with any labels!
- There was one time in iOS, old emails that are irrelevant show up in front in search results. Couldn't replicate on the web or the 2nd day in iOS. Could be a bug...
Overall, I am happy with what I have so far. The Standard plan costs about 76 AUD a year which is very inexpensive. I didn't mention anything about security and privacy because, to be honest, there is no way for me to verify, just have to take their words for it.The only thing left for me to do now is to change all emails in different services and websites. I think this is going to take a while, 10 years maybe...Updates: been using it for almost two months now, still happy.
- Got a reply overnight, although my question was misunderstood, which could be my bad... Anyway, the response time is good.
- Updates: they actually helped me with the Sieve code that implements the custom feature I wanted, very nice and helpful!
- Came across a weird issue with a client's Sitecore instance recently where on CD instances, internal link URLs generated in Navigation or redirects are absolute URLs including hostnames but they are CM hostname instead of CDs'.The Sitecore version is 10.1. SXA and Commerce Storefront. On Docker and AKS.After lots of digging and debugging Sitecore DLLs within docker containers, found the issue and another finding.
Debugging through the code of LinkManager.GetItemUrl, it reaches Sitecore.Links.UrlBuilders.Helpers.OptionsDecoratedSiteResolver.ResolveSite at some point like below:if SkipResolving is true, it takes site context from the default which is correct.However, it is false in this case and it goes to SiteResolver to resolve the site via item only. So there is a chance that the item is resolved to the wrong site since both CM and CD are pointing to the same Sitecore item path and who gets resolved is all dependent on the order of the sites.But why SkipResolving is false?Out of all the code here, LanguageMatchesContextSite is false because of ContextSite.Language is empty but item.Language.Name is "en".It's all because "Language" field of site settings item(such as "/sitecore/content/tenant/Sites/siteA/Settings/Site Grouping/siteA-CM") is blank... After setting this field to "en", the issue is no longer presented.
CD generates URLs with CM hostname is because SXA site settings don't have a language set
This one was not causing a direct issue however could potentially be one. The GetTargetHostName method on SiteInfo is like below:It's easy to see that if Hostname contains any wildcards or pipes and TargetHostName is blank, it would just return an empty string. Which would definitely cause issues somewhere on the site.
Must set "TargetHostname" if "Hostname" contains pipes or wildcards in SXA site settings
- One of the exciting news in the Sitecore world recently was the release of Sitecore Experience Edge for Content Hub (Experience Edge for XM is coming later this year, so will focus on Content Hub for now). If you haven't heard the news yet, I strongly recommend watching this Youtube video to see it in real action. And here is the official Experience Edge™ for Content Hub documentation for a more thorough understanding.To get a hands-on demo experience with Sitecore Experience Edge for Content Hub, please talk to your Sitecore contacts for accessing the Content Hub Sandbox portal. The information below also applies to the Production setup, just ignore the parts related to sandboxes.
You can use Postman to test Delivery and Preview APIs too. Below is an export of a Postman collection:3 variables are:
- You should receive the instructions and accesses to create a sandbox Content Hub environment, just ensure the following when creating the sandbox
- Select version 4.0.0
- Select "Content Publishing" license
- When CH sandbox is up and running, head to Settings->PublishingSettings and ensure "Publishing enabled" is ticked and Save.
- Ensure that there are Content Collections and Content that are in the Final state (This is for viewing them in Delivery API)
- Ensure that the Content Collections and Content have the green tick cloud icon that says "Published to delivery platform"
- You can generate API tokens from Settings->API Keys or from the Content Collections
- The URL to GraphQL IDE is https://[[Your demo instance hostname]]/api/graphql/preview/ide/
- Preview API endpoint for demo container is https://[[Your demo instance hostname]]/api/graphql/preview/v1
- The past year has been a weird year. It went by without much me feeling the time passing. Things happened around the world, but something also happened in our personal life.2020 was not too bad to be honest. We are positive people and of course 2021 will be even better.
subscribe via RSS