尝试登录Keycloak Admin WS [英] Trying to log in to Keycloak Admin WS

查看:269
本文介绍了尝试登录Keycloak Admin WS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过可在路径

http://KeycloakServer:8081/auth/admin/realms

所以在邮递员中,我运行以下请求

So in Postman I run the following request

URL:http://KeycloakServer:8081/auth/admin/realms

方法:POST

身体:

{
    "enabled": true,
    "id": "TestRealm",
}

我得到一个401 Unauthorized响应,因此我认为有必要向Admin WS进行身份验证.但是在文档中,我找不到有关所需身份验证类型和语法的任何信息. 您知道如何向Keycloak WS进行身份验证吗?

I get a 401 Unauthorized response, so I think it is necessary to authenticate to the Admin WS. But in the docs I cannot find any information about the type of authentication required and the syntax. Do you know how to authenticate to the Keycloak WSs?

谢谢

推荐答案

https://hostname:8080/auth/realms/master/protocol/openid-connect/token

Content-Type设置为application/x-www-form-urlencoded

并将以下内容放入正文:

and put the following in the body:

username=<username>&password=<password>&client_id=admin-cli&grant_type=password

这篇关于尝试登录Keycloak Admin WS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆