v-ladynev / keycloak-nodejs-example Goto Github PK
View Code? Open in Web Editor NEWA simply step by step Keycloak, MySQL and Node.js integration tutorial. There are some docker examples as well.
A simply step by step Keycloak, MySQL and Node.js integration tutorial. There are some docker examples as well.
I have upload the shared json file to the Keycloak server for the CAMPAIGN_REALM and
I am able to login to the server with the NOrmal login with which redirects to the Keycloak Login Page.
I have problem while to login to the server with Custom Login for the username: admin_user and passwiord: admin_user.
The below error i am getting at the server side.
http://localhost:8080/auth/realms/CAMPAIGN_REALM/protocol/openid-connect/certs
{ keys:
[ { kid: 'FBfZzrTszXORm6TnVB05RWnV6OpnZYb2aX8kJFr_ZpM',
kty: 'RSA',
alg: 'RS256',
use: 'sig',
n: 'yUO8jLzyWVbW906qQN7DcQmWqnSTstpjJ-VQivC_Yilk1EH-EMj79iOqdMlSaa_T2zO1bZKbjfKBaM28ICT9VzPBRSde0GKQlucxrKdLmESHSJYlHnaPw49YYCBehUvY07wmw2naETXRz-1LbG_iyANCnZkSID8JCL0roBWHhlL5u5WMAnApWLQO2JSl1UcYYr5Souqq0yBytt6HtTpDq4BakPMLq9au8FlniZ-4XAIVZGK6pXc7XZTBJEeU_fLio4IQGt3VpJVhI8RIekXeHrmN-W-DNi1J2n4NMSrY7DqoRvyDQcBkxVZnnhZkhTBiaGFZFqhTZVVqAth4yW8uow',
e: 'AQAB' } ] }
validate id token went wrong
(node:3640) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): TypeError: Cannot set property 'store' of undefined
::ffff:127.0.0.1 - - [04/Oct/2017:19:15:19 +0000] "GET /customLoginEnter?login=admin_user&password=admin_user HTTP/1.1" - - "http://localhost:3000/customLogin" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0"
admin_user
admin_user
validate id token went wrong
(node:3640) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 7): TypeError: Cannot set property 'store' of undefined
Please note that i have not configured the MYSQL data base.
Hello for all,
After doing all configurations my example is working fine, but when I try add a new user the system shown this message on the bottom of the screen:
\n\n<title>404 Not Found</title>\n\nThe requested URL /auth/realms/master/protocol/openid-connect/token was not found on this server.
\nI would like to know how can I do to fix this issue or if keycloak has some external API when I could create new users.
Regards
Paulo
I have imported both json files to keycloak and updated keycloak.json file in app root folder.
I am able to access the application url but post login I am seeing Access denied error in app page.
In app logs I can see below error. can you please help me in resolving the issue.
Grant validation failed. Reason: failed to load public key to verify token
Error: Can't set headers after they are sent.
at validateHeader (_http_outgoing.js:491:11)
at ServerResponse.setHeader (_http_outgoing.js:498:3)
sudo docker run --name keycloak_dev \
--link mysql:mysql \
-p 8080:8080 \
-e MYSQL_DATABASE=KEYCLOAK_DEV -e MYSQL_USERNAME=keycloak -e MYSQL_PASSWORD=keycloak \
-e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin \
ladynev/keycloak-mysql-realm-users
fails with
21:16:14,685 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (ServerService Thread Pool -- 53) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: IJ031084: Unable to create connection
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:345)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:352)
the mysql system is running
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
884c0f8ec741 mysql "docker-entrypoint.sā¦" 10 minutes ago Up 10 minutes 3306/tcp, 33060/tcp mysql
I have no idea on what's wrong or how to even start fixing this ;)
I am facing intermittent issue of getting access denied error after login once the existing session expires.
The error I see in the server logs is 'Could not obtain grant code: Error: 400:Bad Request'.
Steps to reproduce this issue:
Please make the appropriate changes to fix this issue or let me know if there is any way I can fix this issue at my end.
Is there a way to return a different response from the 403
Access denied
?
I would want to return my own error object.
@v-ladynev Thanks for this repo, its very appreciated.
I'm trying to return some custom attributes that I have created for each user to the client. It's unclear to me how to do this. Do you know how I can return this data?
Hello,
Does your example support refresh token or do you know how can I implement this?
Thank you
a license file is missing, package.json states it's Apache2.0
Hey there. Seems you really know what you doing with Keycloak. Could you help me solve my problem? I want to Assign roles to Groups. Tried to do the way do Assing roles to a user, but changed API call. But it seems request doesn't exist.
I used this request I find in official documentation :
POST /{realm}/groups/{id}/role-mappings/realm
Added realmName ID of a group and in body I sand array of objects each contain a name of a role.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ššš
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ā¤ļø Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.