keycloak

keycloak Invalid parameter: redirect_uri

丶灬走出姿态 提交于 2019-11-28 19:09:00
When I am trying to hit from my api to authenticate user from keycloak, but its giving me error Invalid parameter: redirect_uri on keycloak page. I have created my own realm apart from master. keycloak is running on http. Please help me. What worked for me was adding wildchar '*' . Although for production builds, I am going to be more specific with the value of this field. But for dev purposes you can do this. Setting available under, keycloak admin console -> Realm_Name -> Cients -> Client_Name . EDIT: I would not recommend the above solution for production builds as this could lead to a

Keycloak integration in Swagger

房东的猫 提交于 2019-11-28 19:08:47
I have a Keycloak protected backend that I would like to access via swagger-ui. Keycloak provides the oauth2 implicit and access code flow, but I was not able to make it work. Currently, Keycloak's documentation is lacking regarding which url should be used for authorizationUrl and tokenUrl within swagger.json . Each realm within Keycloak offers a huge list of configuration urls by accessing http://keycloak.local/auth/realms/REALM/.well-known/openid-configuration Furthermore I've tried to directly integrate the keycloak js-client within swagger-ui index.html by adding the following lines:

Issuing “API keys” using Keycloak

廉价感情. 提交于 2019-11-28 18:03:46
My setup has three components: A backend application (Python/Flask) A frontend application (VueJS) Keycloak The frontend will use Keycloak to let users sign in and use the access tokens to authenticate requests to the backend. So far so good. Now I want third party applications to be able to make authenticated requests against the backend and I am wondering how that can be realized using Keycloak? My idea is to issue a new set of credentials for each customer. Their application then talks to Keycloak to get access tokens. I can then use Keycloak to manage access control for all users of the

Avoid keycloak default login page and use project login page

99封情书 提交于 2019-11-28 17:02:56
I am working on creating an angular.js web application and looking for how to integrate keycloak into the project. I have read and watched many tutorials and I see that most of them have users logging/registering through the default login page of keycloak which then redirects to the app. I have designed my own login and registration page which I want to use. How do I use them instead of keycloak default. Are there any API that I can call or may be my backend would do that? I also read there are spring adapters available for keycloak, can I use them ? Any link to any example would be good. The

What are Keycloak's OAuth2 / OpenID Connect endpoints?

邮差的信 提交于 2019-11-28 15:38:28
We are trying to evaluate Keycloak as an SSO solution, and it looks good in many respects, but the documentation is painfully lacking in the basics. For a given Keycloak installation on http://localhost:8080/ for realm test , what are the OAuth2 Authorization Endpoint , OAuth2 Token Endpoint and OpenID Connect UserInfo Endpoint ? We are not interested in using Keycloak's own client library, we want to use standard OAuth2 / OpenID Connect client libraries, as the client applications using the keycloak server will be written in a wide range of languages (PHP, Ruby, Node, Java, C#, Angular).

Obtaining user roles in servlet application using keycloak

强颜欢笑 提交于 2019-11-28 03:56:41
问题 I'm using keycloak to protect my servlet. I have to add new roles and assign them to users dynamically. It works in keycloak using admin API, but I can't figure out how to obtain the roles for specific user in a servlet. I tried this solution, but I get empty set: protected void doPost(HttpServletRequest request, HttpServletResponse response) { ... KeycloakSecurityContext context = (KeycloakSecurityContext)request.getAttribute(KeycloakSecurityContext.class.getName()); Set<String> roles =

Keycloak angular No 'Access-Control-Allow-Origin' header is present

风流意气都作罢 提交于 2019-11-27 22:23:14
I Have integrated keycloak with an angular app. Basically, both frontend and backend are on different server.Backend app is running on apache tomcat 8. Frontend app is running on JBoss welcome content folder. Angular config angular.element(document).ready(function ($http) { var keycloakAuth = new Keycloak('keycloak.json'); auth.loggedIn = false; keycloakAuth.init({ onLoad: 'login-required' }).success(function () { keycloakAuth.loadUserInfo().success(function (userInfo) { console.log(userInfo); }); auth.loggedIn = true; auth.authz = keycloakAuth; auth.logoutUrl = keycloakAuth.authServerUrl + "

Is there an API call for changing user password on keycloak?

﹥>﹥吖頭↗ 提交于 2019-11-27 17:15:45
问题 I am trying to implement my own form for changing a user's password. I tried to find an API for changing a user's password in Keycloak but I couldn't find anything in the documentation. Is there an API for doing it? 回答1: you can use PUT /auth/admin/realms/{realm}/users/{id}/reset-password {id} is the user id in keycloak (not the login) Here is s sample body. { "type": "password", "temporary": false, "value": "my-new-password" } 回答2: Rather than specifying a new password manually a better

Keycloak add extra claims from database / external source

自闭症网瘾萝莉.ら 提交于 2019-11-27 16:29:44
问题 I have not been able to divine the way I might add extra claims from my application database. Given my limited understanding, I see two ways: After successful authentication have keycloak pull extra claims from the application database somehow. This app database is postgres, for example. Have the application update the jwt with extra claims using a shared key. I would like some feedback both paths. I feel that the fist option may be safer. However I am not sure where to begin that

Keycloak-gatekeeper: 'aud' claim and 'client_id' do not match

不羁的心 提交于 2019-11-27 16:08:05
问题 What is the correct way to set the aud claim to avoid the error below? unable to verify the id token {"error": "oidc: JWT claims invalid: invalid claims, 'aud' claim and 'client_id' do not match, aud=account, client_id=webapp"} I kinda worked around this error message by hardcoding aud claim to be the same as my client_id . Is there any better way? Here is my docker-compose.yml : version: '3' services: keycloak-proxy: image: "keycloak/keycloak-gatekeeper" environment: - PROXY_LISTEN=0.0.0.0