README.md 1.81 KiB
VPU Auth Web Component
Usage
<vpu-auth client-id="my-client-id"></vpu-auth>
Attributes
-
client-id
(mandatory): set the client id that you have setup on your Keycloak server- example
<vpu-auth client-id="my-client-id"></vpu-auth>
- example
-
lang
(optional, default:de
): set tode
oren
for German or English- example
<vpu-auth lang="de" client-id="my-client-id"></vpu-auth>
- example
-
load-person
(optional, default: off): if enabled the logged in user will also be loaded asPerson
in thewindow.VPUPerson
variable- example
<vpu-auth client-id="my-client-id" load-person></vpu-auth>
- example
-
force-login
(optional, default: off): if enabled a login will be forced, there never will be a login button- example
<vpu-auth client-id="my-client-id" force-login></vpu-auth>
- example
-
remember-login
(optional, default: off): if enabled a login will be forced if the user was logged in, in the same session- example
<vpu-auth client-id="my-client-id" remember-login></vpu-auth>
- example
Events to listen to
-
vpu-auth-init
: Keycloak init event - happens once -
vpu-auth-person-init
: Keycloak person init event - the person entity was loaded from the server -
vpu-auth-keycloak-data-update
: Keycloak data was updated - happens for example every time after a token refresh
Local development
# get the source
git clone git@gitlab.tugraz.at:VPU/WebComponents/Auth.git
cd Auth
git submodule update --init
# install dependencies (make sure you have npm version 4+ installed, so symlinks to the git submodules are created automatically)
npm install
# constantly build dist/bundle.js and run a local web-server on port 8002
npm run watch-local
Jump to http://localhost:8002 and you should get a Single Sign On login page.