Skip to content

Ulysses Neves

Microsoft Entra ID, authentication, and hybrid identity troubleshooting.

Menu
  • Início
  • Microsoft Azure
  • Microsoft AD FS
  • Microsoft 365
  • Contact
Menu

AD FS – Fixing error message MSIS9605: The client is not allowed to access the requested resource on AD FS 2019

Posted on 3 de August de 2021

Hi mates. Today we’re going to work on the error MSIS9605: The client is not allowed to access the requested resource. on AD FS when a hybrid device tries to get an Enterprise PRT.

To reproduce the issue, let’s consider the scenario below:

AD FS: 2019
Device Registration Service: Enabled
Client: Windows 10
Join type: Hybrid Join
Issue: Hybrid device not able to receive Enterprise PRT

Enterprise PRT

The Enterprise PRT can be used for device authentication on-premises when you have policies evaluating the device status. For hybrid Azure AD joined devices, the device could have PRT from both Azure AD and on-premises AD simultaneously. On-premises joined devices will only have an Enterprise PRT.

Troubleshooting

To identify if the device is not able to acquire the PRT, let’s run the command dsregcmd /status on the affected machine. We might get the output similar to this below:

+———————————————————————-+
| SSO State |
+———————————————————————-+

            AzureAdPrt : YES
  AzureAdPrtUpdateTime : 2021-05-31 15:35:27.000 UTC
  AzureAdPrtExpiryTime : 2021-06-14 15:35:26.000 UTC
   AzureAdPrtAuthority : https://login.microsoftonline.com/TenantID
         EnterprisePrt : NO
EnterprisePrtAuthority : https://adfs2019.ulyneves.com:443/adfs

On the client’s event viewer:
You might see we see events 1025, 1118 and 1081 on event viewer looking for path Microsoft-Windows-AAD/Operational as below:

Http request status: 400. Method: POST Endpoint Uri: https://fs.contoso.com/adfs/oauth2/token/ Correlation ID: 225BEAC5-37F8-4A2E-8D2C-BA2A819FE2F3

OAuth response error: unauthorized_client
Error description: MSIS9605: The client is not allowed to access the requested resource.

Enterprise STS Logon failure. Status: 0xC000006D Correlation ID: 225BEAC5-37F8-4A2E-8D2C-BA2A819FE2F3

On AD FS server:
If AD FS Tracing logs are enabled, you might see we see events with ID 178 on event viewer looking for path AD FS Tracing/Debug as below:

An OAuth Access Token could not be issued for next generation credentials grant: to client ’38aa3b87-a06d-4817-b275-7a316988d93b’ for resource ‘http://schemas.microsoft.com/ws/2009/12/identityserver/selfscope’.
The client IP is ‘X.X.X.X’
. The Exception encountered: ‘Microsoft.IdentityServer.Web.Protocols.OAuth.Exceptions.OAuthUnauthorizedClientException: MSIS9368: Received invalid OAuth request. The client ’38aa3b87-a06d-4817-b275-7a316988d93b’ is forbidden to access the resource ‘http://schemas.microsoft.com/ws/2009/12/identityserver/selfscope’ with scope ‘ugs’.
at Microsoft.IdentityServer.Web.Protocols.OAuth.OAuthProtocolContext.ValidateScopes(String scopeParameter, String clientId, String relyingPartyId)
at Microsoft.IdentityServer.Web.Protocols.OAuth.OAuthToken.OAuthJWTBearerRequestContext.ValidateCore()
at Microsoft.IdentityServer.Web.Protocols.ProtocolContext.Validate()
at Microsoft.IdentityServer.Web.Protocols.OAuth.OAuthToken.OAuthTokenProtocolHandler.PreAuthenticationProcess(ProtocolContext context)’

On AD FS Admin logs, you might see error message below:

The input parameters in the received OAuth JWT bearer Request are found to be invalid
Encountered error during OAuth token request.
Additional Data
Exception details:
Microsoft.IdentityServer.Web.Protocols.OAuth.Exceptions.OAuthUnauthorizedClientException: MSIS9368: Received invalid OAuth request. The client ’38aa3b87-a06d-4817-b275-7a316988d93b’ is forbidden to access the resource ‘http://schemas.microsoft.com/ws/2009/12/identityserver/selfscope’ with scope ‘ugs’.
at Microsoft.IdentityServer.Web.Protocols.OAuth.OAuthProtocolContext.ValidateScopes(String scopeParameter, String clientId, String relyingPartyId)
at Microsoft.IdentityServer.Web.Protocols.OAuth.OAuthToken.OAuthJWTBearerRequestContext.ValidateCore()

Fix: As reported by Microsoft on this public documentation, AD FS running on Windows Server 2019 fails to complete device authentication properly due to an invalid check of incoming scopes in the request. Device authentication to AD FS is a requirement for Windows Hello for Business to enroll a certificate using AD FS. The client will block Windows Hello for Business provisioning until this authentication is successful.

This certificate issue on AD FS version 2019 can be fixed manually creating the scope on AD FS and configuring the application permissions.

Run the command below on the primary AD FS server using PowerShell:

Add-AdfsScopeDescription -Name ugs 
$app = (Get-AdfsApplicationPermission -ServerRoleIdentifiers "http://schemas.microsoft.com/ws/2009/12/identityserver/selfscope" | ?{ $_.ClientRoleIdentifier -eq "38aa3b87-a06d-4817-b275-7a316988d93b" }).ObjectIdentifier 
Set-AdfsApplicationPermission -TargetIdentifier $app -AddScope 'ugs'
Restart-Service ADFSSRV

Validating the Enterprise PRT

With the scope created on AD FS, we do a fresh sign in and confirm the EnterprisePRT is issued by AD FS running command dsregcmd /status as below:

+———————————————————————-+
| SSO State |
+———————————————————————-+

            AzureAdPrt : YES
  AzureAdPrtUpdateTime : 2021-05-31 16:07:03.000 UTC
  AzureAdPrtExpiryTime : 2021-06-14 16:07:02.000 UTC
   AzureAdPrtAuthority : https://login.microsoftonline.com/tenantID
         EnterprisePrt : YES
EnterprisePrtUpdateTime : 2021-05-31 16:07:04.000 UTC
EnterprisePrtExpiryTime : 2021-06-14 16:07:04.000 UTC
EnterprisePrtAuthority : https://fs.contoso.com:443/adfs

On AD FS server, checking the AD FS tracing logs, we see event ID 34 with messages below that confirms the client being able to retrieve the details on scope below:

Successfully retrieved scope details for scope http://schemas.microsoft.com/ws/2009/12/identityserver/selfscope
Successfully retrieved scope details for scope urn:federation:MicrosoftOnline

Summary

In this article, we covered how to workaround the AD FS error MSIS9605: The client is not allowed to access the requested resource. when a hybrid device tries to get an Enterprise PRT.

I hope you have enjoyed reading this article and it helps you manage your AD FS environment.

Enjoyed the article? Like and share. 🙂

Note: I do not represent the organization I work for, all the opinions expressed here, are my own. This post is provided AS IS with no warranties or guarantees and confers no rights.

In case you have any suggestion or feedback, please leave a comment.

[ ]’s
Ulysses Neves

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Microsoft Authenticator Will Block Jailbroken Devices in 2026 — What You Need to Know 17 de March de 2026
  • Enhancing Azure role activation security with FIDO2/Passkeys 23 de September de 2024
  • Microsoft Entra ID CAP | Enforcing WHfB using Authentication Strength 21 de April de 2024
  • Troubleshooting Error Code ‘0x000005e’ in WHfB: PIN Authentication Woes 11 de February de 2024
  • WHfB: Fixing Windows Hello for Business error ‘LogoncertTemplateReady: NO (StateNoTemplate)’ 29 de December de 2023

Archives

  • March 2026
  • September 2024
  • April 2024
  • February 2024
  • December 2023
  • September 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019

Tags

#aaddownleveldevice #aadhybridjoin #adfs #adfsonsql #azuread #azureauth #azureCA #azuredevice #azurehybridjoin #azuremfa #azuresecurity #capolicy #cloudkerberostrust #conditionalaccess #conditionalaccesspolicy #deviceregistration #gmsaaccount #gopasswordless #hybridaadjoin #mfaserver #msadfs #msazure #msidentity #namedlocation #sslcertificatevalidation #tshootadfs #tshoothybridjoin #tshootwaptrust #waptrust #WHFBcerttrust #whfbdeployment #WHfBhybridsetup #widdatabase adconnect authenticationcontext authenticationstrength az500 azuread azuremfa azurepim azuresecurity cloudsecurity microsoft365 msazure WHfB
©2026 Ulysses Neves | Design: Newspaperly WordPress Theme
Ulysses Neves
Gerenciar Consentimento de Cookies
Para fornecer as melhores experiências, usamos tecnologias como cookies para armazenar e/ou acessar informações do dispositivo. O consentimento para essas tecnologias nos permitirá processar dados como comportamento de navegação ou IDs exclusivos neste site. Não consentir ou retirar o consentimento pode afetar negativamente certos recursos e funções.
Funcional Always active
O armazenamento ou acesso técnico é estritamente necessário para a finalidade legítima de permitir a utilização de um serviço específico explicitamente solicitado pelo assinante ou utilizador, ou com a finalidade exclusiva de efetuar a transmissão de uma comunicação através de uma rede de comunicações eletrónicas.
Preferências
O armazenamento ou acesso técnico é necessário para o propósito legítimo de armazenar preferências que não são solicitadas pelo assinante ou usuário.
Estatísticas
O armazenamento ou acesso técnico que é usado exclusivamente para fins estatísticos. O armazenamento técnico ou acesso que é usado exclusivamente para fins estatísticos anônimos. Sem uma intimação, conformidade voluntária por parte de seu provedor de serviços de Internet ou registros adicionais de terceiros, as informações armazenadas ou recuperadas apenas para esse fim geralmente não podem ser usadas para identificá-lo.
Marketing
O armazenamento ou acesso técnico é necessário para criar perfis de usuário para enviar publicidade ou para rastrear o usuário em um site ou em vários sites para fins de marketing semelhantes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
Ver preferências
  • {title}
  • {title}
  • {title}