Example API in NestJS with authorization from OAuth2 provider (Keycloak in this case) and local authorization via JWT.
Prerequisites:
$ yarn install --frozen-lockfile
Hit commands in terminal and enjoy working with application
$ docker compose up --detach
$ yarn dev
Backend application have integration to external user provider. Locally it's
Keycloak which is preconfigured with my-app
realm. Available users:
admin
withPassword1
password,
user
withPassword1
password.
Notice that users are named like admin/user, but actually we don't fetch any roles data from OAuth2 token.
Keycloak have admin console via WebUI available at http://localhost:8080/. Admin account is predefined with environments in docker-compose file.
Hit admin
with admin
password to login to console.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
No tests so please make sure you want to add some or check it twice manually :wink: