Skip to content
Snippets Groups Projects
Select Git revision
  • f7bf48d335e175b060dca8351da5d4b3856a5163
  • main default protected
  • renovate/lock-file-maintenance
  • demo protected
  • person-select-custom
  • dbp-translation-component
  • icon-set-mapping
  • port-i18next-parser
  • remove-sentry
  • favorites-and-recent-files
  • revert-6c632dc6
  • lit2
  • advertisement
  • wc-part
  • automagic
  • publish
  • wip-cleanup
  • demo-file-handling
18 results

auth

Christoph Reiter's avatar
Reiter, Christoph authored
With the new ability to log in without redirecting to keycloak and reloading the page
we can now try to login on start every time.

Instead of remembering the login state in the session storage we just ask keycloak in an iframe
on start. To better describe this new behaviour rename the attribute from remember-login to try-login.
f7bf48d3
History

VPU Auth Web Component

GitLab Repository

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>
  • lang (optional, default: de): set to de or en for German or English
    • example <vpu-auth lang="de" client-id="my-client-id"></vpu-auth>
  • load-person (optional, default: off): if enabled the logged in user will also be loaded as Person in the window.VPUPerson variable
    • example <vpu-auth client-id="my-client-id" load-person></vpu-auth>
  • 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>
  • try-login (optional, default: off): if enabled the a login will happen if the user is already logged in and finishing the login process would not result in a page location change (reload/redirect).
    • example <vpu-auth client-id="my-client-id" try-login></vpu-auth>

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.