php editor Apple introduced that when you use Keycloak with krakend to log in correctly, you may sometimes encounter error 403. A 403 error usually means that the server rejected the request, which may be caused by insufficient permissions or blocked access. There are several ways to resolve this issue, including checking permission settings, confirming the validity of login credentials, checking network connections, etc. Through step-by-step troubleshooting, this problem can be effectively solved to ensure smooth access to the required resources.
Hi, I'm trying to authenticate using Keycloak and Krakend, I can send my request, log in, then when I try to access the resource (using Insomnia) I get:
403 Forbidden: No response body returned.
I don't know why this is happening, please help!
This is my Krakend.json configuration file:
82BC1186967c2a759b3162034d07be32In Keycloak I created my realm, user with credentials (with admin rights) and client, I think this is correct because my login with access token works fine, after logging in I get 403.
This is the service I wrote in go:
func JSONHandler(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"ciao": "ciao"}) } func Init() { router := gin.Default() router.Use(middlewares.CORS()) router.GET("/api", JSONHandler) err := router.Run(":8080") if err != nil { log.Fatal("Oh no") } }
Modify fields:
"$schema": "https://www.krakend.io/schema/v3.json"
to
"$schema": "https://www.krakend.io/schema/v2.4.3.json"
Solved my problem!
The above is the detailed content of Keycloak with krakend giving error 403 after logging in correctly?. For more information, please follow other related articles on the PHP Chinese website!