How to add HTTP methods in Keycloak resources for Authorization (Without adapters)

删除回忆录丶 提交于 2020-06-29 03:53:42

问题


When using Keycloak for authorization it allows creating protected resources. But it only allows defining the URI. How can I also add the HTTP method for the resource?

Although it seems the policy enforcers allows us to define such details, how is Keycloak able to map the HTTP method with the resource?

Thanks in Advance.


回答1:


If you want scopes to be mapped to HTTP methods then you need to set http-method-as-scope to true.

You can check policy enforcer documentation here

With spring-boot adapter you can set keycloak.policy-enforcer-config.http-method-as-scope=true and your resources would be associated with scopes such as GET, PUT, POST, DELETE, etc.



来源:https://stackoverflow.com/questions/62323931/how-to-add-http-methods-in-keycloak-resources-for-authorization-without-adapter

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!