Hypersign authenticator for Keycloak
./build.sh
git tag <version_name>
git push origin --tags
Setup keycloak
using code
# clone
git clone https://github.com/keycloak/keycloak
cd keycloak
# build and install
mvn -Pdistribution -pl distribution/server-dist -am -Dmaven.test.skip clean install
# untar
tar xfz distribution/server-dist/target/keycloak-<VERSION>.tar.gz
# run server
cd keycloak-<VERSION>
nohup ./bin/standalone.sh &
OR using docker
./install.sh
This will pull and run keycloak docker from keycloack repo.
Note:
- In case you get any error, re-run the command once again.
- The keycloack server should run on http://localhost:8080
- Open Eclipse IDE and select Import exisiting maven project
- Browse the folder where hs-authenticator is already downloaded and import it to your eclipse worksapce.
- Set
KCBASE
env variable in thebashrc
vim ~/.bashrc
export KCBASE="/home/vishswasb/work/proj/hm/keycloak/keycloak-8.0.0-SNAPSHOT" # path to keycloak home directory
# save and close vim
source ~/.bashrc
- Set the database for keycloak [One-time]
./keycloak-db-setup.sh
- Set the webcontext for keyclack [One-time]
./keycloak-webcontext-setup.sh
- Now deploy hs-authenticator and run keycloak
./clean-build-install.sh
- Setup any client application, for example:
localhost:3000
- Open
localhost:3000
in browser - Get the
sessionId
fromnetwork
, ex:c10cdc4b-3dab-40e9-be0a-c261c3123442
. - Use POSTMAN to call
/sign
api with userId in the formatKeycloak-Base-Url/auth/realms/master/hypersign/sign/{sessionId}/{userId}
asdadhttp://localhost:8080/auth/realms/master/hypersign/sign/c10cdc4b-3dab-40e9-be0a-c261c3123442/65fa0884-24ae-4c25-9260-df0f170290dc