OAuth request failed

Microsoft.ActiveDirectoryFederationServices.2012.R2.AuthenticationOAuthRequestFailedErrorMonitor (UnitMonitor)

This monitor captures errors for OAuth authorization and token requests failures

Knowledge Base article:

Summary

This monitor checks for repeated errors on OAuth requests.

If no OAuth requests errors occur again within 15 minutes, the health state of this monitor will change back to a Green state and the alert associated will be closed automatically.

Causes

Possible OAuth request errors include:

1. Authorization requests contain incorrect client, redirect URL or resource parameters.

2. Token requests contain incorrect or stale authorization code or refresh token parameters.

3. An unhandled exception occurred while attempting to process the request.

Resolutions

For cause (1) above, contact the client application owner, and verify the configuration of the client and relying party trust objects using AD FS Windows PowerShell cmdlets.

For cause (2) above, contact the client application owner for further troubleshooting. If the requests contain stale authorization code or refresh tokens, it is possible that the client application has a code defect.

For cause (3), check the exception message in the event log for further information.

Element properties:

TargetMicrosoft.ActiveDirectoryFederationServices2012R2.Authentication
Parent MonitorSystem.Health.ConfigurationState
CategoryConfigurationHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.Windows.RepeatedEventLogTimer2StateMonitorType
RemotableTrue
AccessibilityPublic
Alert Message
OAuth request failed
Please see the alert context for details.
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.ActiveDirectoryFederationServices.2012.R2.AuthenticationOAuthRequestFailedErrorMonitor" Accessibility="Public" Enabled="true" Target="Microsoft.ActiveDirectoryFederationServices2012R2.Authentication" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="Windows!Microsoft.Windows.RepeatedEventLogTimer2StateMonitorType" ConfirmDelivery="true">
<Category>ConfigurationHealth</Category>
<AlertSettings AlertMessage="Microsoft.ActiveDirectoryFederationServices.2012.R2.AuthenticationOAuthRequestFailedErrorMonitor_AlertMessageResourceID">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
</AlertSettings>
<OperationalStates>
<OperationalState ID="RepeatedEventRaised" MonitorTypeStateID="RepeatedEventRaised" HealthState="Warning"/>
<OperationalState ID="TimerEventRaised" MonitorTypeStateID="TimerEventRaised" HealthState="Success"/>
</OperationalStates>
<Configuration>
<RepeatedComputerName>$Target/Host/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</RepeatedComputerName>
<RepeatedLogName>AD FS/Admin</RepeatedLogName>
<RepeatedExpression>
<And>
<Expression>
<Or>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="UnsignedInteger">EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="UnsignedInteger">1020</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="UnsignedInteger">EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="UnsignedInteger">1021</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</Or>
</Expression>
<Expression>
<RegExExpression>
<ValueExpression>
<XPathQuery Type="String">PublisherName</XPathQuery>
</ValueExpression>
<Operator>MatchesRegularExpression</Operator>
<Pattern>(^AD FS$)</Pattern>
</RegExExpression>
</Expression>
</And>
</RepeatedExpression>
<Consolidator>
<ConsolidationProperties/>
<TimeControl>
<WithinTimeSchedule>
<Interval>60</Interval>
</WithinTimeSchedule>
</TimeControl>
<CountingCondition>
<Count>10</Count>
<CountMode>OnNewItemTestOutputRestart_OnTimerSlideByOne</CountMode>
</CountingCondition>
</Consolidator>
<TimerWaitInSeconds>900</TimerWaitInSeconds>
</Configuration>
</UnitMonitor>