Testbefund Generator
Getting Started
Configuration
To allow for flexible configuration with environment variables, we are using a runtime-loaded config.js
to store secrets and configuration. That, unfortunately, means you will have to do some work
before you can start the application.
- Go to
src/assets
- Copy the
sample-config.js
intoconfig.js
- Fill in necessary data. See
Authentication with Azure AD
for more information on the tenant id and the client id
Authentication with Azure AD
Testbefund Generator utilizes Azure AD and the OIDC Auth Code flow to login the user.
Upon loading the page, the user will be redirected to the Microsoft login page. After login, the user will receive two tokens:
- The access token, which we aren't currently using (see below)
- The ID token, which we will be using to authenticate against the API.
The returned ID token is then used in the testbefund-auth-interceptor.service.ts
. The service
sets the Authorization
header with the Bearer <token>
value, allwoing access to the
protected testbefund API.
Setting up your own Azure AD Application
If you wish to run this application locally, you will need access to either the Testbefund Azure AD or your own.
You can easily set up your own Azure AD and your own application. To do so, please follow Microsoft's Guide to Applications
You will want to set the redirect URl to http://localhost:4200/login-successful
IMPORTANT When setting up the redirect URLs, make sure to select Web Application
to
be able to use the auth code flow!
Once done, set your TENANT_ID
and CLIENT_ID
in the config.js.
ID Token vs Access Token
We are using the ID token returned by Azure AD because, for some reasons, the Access token can not be validated by spring security (or jwt.io...). This seems to be a known problem, which Microsoft has yet to address.
Starting the App
Once you got your configuration all set up, start testbefund-generator
like any other angular app.
yarn (preferred)
yarn install
yarn run start
- Open
http://localhost:4200/
npm
npm install
npm run start
- Open
http://localhost:4200/