Description | This article describes how to fix OAuth authentication server error 403 and OAuth login failed: invalid_request. |
Scope | FortiTrust Identity and FortiAuthenticator v6.5, v6.6. |
Solution |
When settings up OAuth for the first time, the authentication process might fail with error 403 for the end user after the credentials are validated.
Validated credentials raw log: If credential validation fails, that must be troubleshooted first.
Log Details
The error corresponding to the error 403 looks like this in the raw logs:
Log Details
One reason for this error is the Authorization grant type mismatch, Password-based or Authorization code.
The REST API debug can also show which Authorization grant type is the Relying party using:
2025-02-06 12:04:49,654 debug 27165 140155504080576 Selecting handler for request <oauthlib.openid.connect.core.grant_types.authorization_code.AuthorizationCodeGrant object at 0x7f787cb046d0>.
In this example, the Relying party Nextcloud is using by default Authorization code, but the FortiAuthenticator's default is Password-based.
Another reason for the error 403, but without or very little OAuth events, can be the OAuth Service not being enabled on the interface. |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.