Reactjs 如何在KeyClope'中使用身份提供程序;什么是RESTAPI?
我目前正在从我自己的“拼凑”身份验证系统切换到KeyClope。目前,我在试图弄清楚如何使用身份提供者使用KeyClope登录时遇到了一些困难。到目前为止,我能够使用rest API轻松添加身份提供程序:http://localhost:8080/auth/admin/realms/test/usersReactjs 如何在KeyClope'中使用身份提供程序;什么是RESTAPI?,reactjs,rest,oauth,keycloak,Reactjs,Rest,Oauth,Keycloak,我目前正在从我自己的“拼凑”身份验证系统切换到KeyClope。目前,我在试图弄清楚如何使用身份提供者使用KeyClope登录时遇到了一些困难。到目前为止,我能够使用rest API轻松添加身份提供程序:http://localhost:8080/auth/admin/realms/test/users {"firstName":"FIRSTNAME","lastName":"LASTNAME", "ena
{"firstName":"FIRSTNAME","lastName":"LASTNAME", "enabled":"true", "username":"app-user", "federatedIdentities": [{"identityProvider": "google", "userId": "XXXXXXXXXXXXXX", "userName": "XXXX XXXXXXXXXXXX"}]}
在进入管理面板并通过web界面登录之后,一切似乎都正常
我目前正在尝试使用RESTAPI登录,但我一直收到以下错误
{
"error": "invalid_grant",
"error_description": "Code not valid"
}
使用以下URL和参数
http://localhost:8080/auth/realms/test/protocol/openid-connect/token
clinet_id=test
grant_type=authorization_code
code=XXXX(pulled from frontend using react-social-login)
redirect_uri=http://localhost:8080/redirect
client_secret=XXXXXX
任何帮助都将不胜感激,因为我希望能够使用REST API完成所有登录,如果您还建议切换到最适合我的应用程序(从前端传递信息并在后端授权),请让我知道