> For the complete documentation index, see [llms.txt](https://docs.wellcomecollection.org/archivematica/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wellcomecollection.org/archivematica/debugging-archivematica/troubleshooting-known-errors/troubleshooting-3.md).

# "Unauthorized for url" when logging in

In October 2021, we saw issues logging into Archivematica. Logged-in users would see an internal server error in the dashboard, and we saw this error in the logs:

> HTTPError: 401 Client Error: Unauthorized for url: <https://login.microsoftonline.com/3b7a675a-1fc8-4983-a100-cc52b7647737/oauth2/v2.0/token>

This means the Archivematica client secret in Azure AD has expired. You can tell this is the case when you log into the [Azure portal](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/Overview/appId/8dccdaeb-e67e-417f-bebc-7aab4abade28/isMSAApp/) and see this screen:

<figure><img src="https://681624210-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDAM268qVZ2nrq3bsj6TI%2Fuploads%2Fgit-blob-27634decf6ef0e6ab33bb6d41d4170715666179f%2Fexpired_secret.png?alt=media" alt=""><figcaption></figcaption></figure>

If so, follow the instructions [to regenerate the Azure AD secrets](https://github.com/wellcomecollection/archivematica-infrastructure/tree/main/docs/azure_ad_login/README.md).
