“Sorry, There was an error: unauthorized_client” error when trying to log in with custom url on Sitecore 9.2 Azure

This was one of those Duh! errors, that looked like below.

Once upon a time, I was getting Sitecore ready to roll for a client on Azure. Sitecore spun everything up for us. I got the code copied over and everything started working. The first complaint the client had was those long complicated hostnames. i.e. https://mc-abcdef-1111-2222-3333-asdqwe-cm.azurewebsites.net, but that’s another blog post for another day.

I got everything working as the go-live date started approaching fast. Was time for a final clean up and set up and along came the custom domain name to map to that server. CD went fine. CM site showed up on the sm.website.com perfectly ok but alas! going to /Sitecore/login started erroring out. I freaked me out a little bit as I have not faced this error on my 4 years of setting this monster up.

First stop, I always bug those Sitecore support people. They are awesome and very responsive. They may block me soon for creating too many premature tickets but it gives me peace of mind knowing that someone else is on it other than me.

But how I fixed it?

Go to your SI server. Head on over to Azure app service editor. Find the Sitecore.IdentityServer.Host.xml file inside Config/production/ folder.

Screen Shot 2020-02-10 at 1.10.06 PM

and then you know what to do from the other more useful blog posts 🙂
Add this line inside <AllowedCorsOrigins> tag:

<AllowedCorsOriginsGroup1>http://cm.website.com|https://</AllowedCorsOriginsGroup1>

 

see, the mistake I did was not look inside the production folder above. the file you want is inside the production folder and not the one on the root. That one is empty. My bad.

 

OH! You also need to restart the app pool on the SI server. I have no idea how to do that on Azure. So, I restarted the app service. things started working as expected.

 

~ When in doubt, as an expert, & when you solve it, write it down for someone else. ~

 

Sitecore 9.2 on Azure Web App: Runtime error with no clue in logs

Sitecore was working fine in the morning. Then you went for coffee and things broke. Beyond your comprehension, you try to blame Sitecore devs for a flimsy application but its been all your fault (somehow)?

In my case, I kept getting this error everywhere. in /sitecore and outside. without showconfig and other tools, I felt helpless.

Screen Shot 2019-12-16 at 9.09.04 AM

At least the logs were generating. Every minute there was one new log with this text in it.Screen Shot 2019-12-16 at 9.09.50 AM

First time in my life seeing this. I felt like a Sitecore virgin in an Azure Orgy.

 

but fear not. Azure was helpful. Even when Sitecore slack, Google and StackExchange did not. I went as deep as deadlock resolving for a different version.

Lookey here: https://kb.sitecore.net/articles/910936

finally, Kiran Vai’s article set me straight.

https://sitecorebasics.wordpress.com/2018/12/25/troubleshoot-and-fix-crashing-sitecore-902-application-on-azure-app/

Logged on to Azure. Collected memory dump.

At first, it was of no use.

Screen Shot 2019-12-16 at 11.02.55 AM

I felt myself getting stuck in LIMBO.

but kept scrolling for that little glimmer of hope. and found this. Screen Shot 2019-12-16 at 11.03.34 AM

I flipped my table and went for a coffee.

When I came back. Restored the connectionstrings.config file. I did not even scroll down anymore. I did not even want to know why and how it got broken. I did not want to find out why Sitecore could not give me a yellow screen of death with this error. I just moved on with my life. And you should too….

 

 

~ Don’t try to change something, try so that something cannot change you. ~

Sitecore on Azure PAAS: how to get rid of the default azure page?

This one time in band-camp I was setting up Sitecore on azure. doing the usual

  • copy database
  • change connection strings
  • copy code
  • copy files
  • copy dlls and configs

but then the site homepage was not loading. It kept showing the default azure homepage.

Screen Shot 2019-12-12 at 4.09.46 PM

to fix this. Log on to the portal.

find your App Service > Configuration > Default Documents

add default.aspx and get rd of hostingstart.html

Screen Shot 2019-12-12 at 4.10.42 PM

and that’s the feeling you get when a wise person once said: “Voila!”

~ Water bottles are a first world problem, that ends up in the third world problem. ~

Azure SQL Server new Database import and username setup

You have moved to the cloud. Congrats!

Image result for cloud gif

  1. Find the databases
  2. Set Server Firewall
  3. Add Client IP
  4. Then check out the ADO.NET Connection string
  5. will have the server name, username, and password
  6. Make sure to have the 1433 port number when connecting with SSMS
  7. After connecting to the database
  8. I was able to Import my .bacpac file
  9. Then came the problem fo the new databases username and password that Sitecore will connect with
  10. Run this script on the newly imported database:
    ALTER USER masteruser WITH PASSWORD = 'asdfghjklmznxcvn';
    EXEC sp_addrolemember 'db_owner', 'masteruser';
  11. This will reset the password and give the new user the necessary access.
  12. Then change the connectionstrings.config in the App_Config folder
  13. and Voila!
  14. Your Sitecore is now using the new database.

 

~ always ask, Without asking you will not get answers. ~