Aam-Digital / account-backend

GNU General Public License v3.0
0 stars 0 forks source link

Cleanups & Improvements on initial master #5

Closed sleidig closed 2 years ago

sleidig commented 2 years ago

https://github.com/Aam-Digital/account-backend/blob/7700b237a0429132a8918b3e6b9601ebc3b764b7/src/auth/bearer/bearer.strategy.ts#L15-L28 is the call to the external url really necessary? Isn't JWT designed to be validated locally without requiring state/interaction from the authority issuing the token?

https://github.com/Aam-Digital/account-backend/blob/7700b237a0429132a8918b3e6b9601ebc3b764b7/src/account/account/account.controller.ts#L27

TheSlimvReal commented 2 years ago

The call to the external URL is used to verify the JWT token against the realm and client which issued the token. If we would want to verify the token without Keycloak, we would need access to the public key of each realm because of the multi-tenant setup. This approach seamed easier to me as there is no high throughput expected.