I have implemented sample spring boot rest API(protected) and authenticated it with locally installed keycloak server. It works perfectly fine.
Later i tried to do the same using keycloak docker, able to get access token using postman, however getting 403 forbidden error(Tested from postman) while trying to access protected service.
Instead of using access token, even i tried using RPT token, but still the same error. I'm unable to access any of the protected service.
What steps do i need to take to access protected services using keycloak Docker ?
application.properties
keycloak.realm=Demo
keycloak.auth-server-url=http://XXX.XX.X.XX:8080/auth -- Keycloak Docker
keycloak.ssl-required=none
keycloak.resource=Demo_Client
keycloak.bearer-only=true
keycloak.credentials.secret=44dae7ee-d81d-4070-a307-2315764afa39
keycloak.use-resource-role-mappings=false
keycloak.cors=true
keycloak.securityConstraints[0].authRoles[0]=admin
keycloak.securityConstraints[0].authRoles[1]=manager
keycloak.securityConstraints[0].securityCollections[0].patterns[0] =/demoRestApi
keycloak.policy-enforcer-config.paths[0].path=/demoRestApi
keycloak.policy-enforcer-config.paths[0].methods[0].method=GET
keycloak.policy-enforcer-config.paths[0].methods[0].scopes[0]=view
keycloak.policy-enforcer-config.paths[0].methods[1].method=DELETE
keycloak.policy-enforcer-config.paths[0].methods[1].scopes[0]=delete