# auth

This library was generated with [Nx](https://nx.dev).

## Running unit tests

Run `nx test auth` to execute the unit tests.

## Using login page assets

You can use login.html, login.css and oidc-callback-handling.js by configuring in your angular.json at `projects.<your-project>.architect.build.options.assets`:
```
{
    "glob": "**/*",
    "input": "./node_modules/@bci-web-core/auth/dist/assets",
    "output": "/assets"
},
```
This will make those assets available at `/assets/auth`, e.g. `/assets/auth/login.html`. Please make sure to change styling and legal contents (footer) as required.
The library expects a `login.html` sending an `oidc-code-message` event and a `renew.html` sending a `oidc-silent-renew-message` event each containing the url as the event details.

## OIDC token refresh / renewal handling

Currently there are two common options for token refresh / token renewal:
* using refresh tokens
    * does allow for invisible autologin. Use `useRefreshToken` option to enable this
* silent renewal with a hidden iframe
    * no refresh token required
    * requires workarounds in cross-domain authorization settings due to blocked third party cookies and browser's tracking protection
