jezzsantos / saastack

A comprehensive codebase template for starting your real-world, fully featured SaaS web products. On the .NET platform
The Unlicense
44 stars 13 forks source link

SSO Token refresh #48

Closed jezzsantos closed 3 months ago

jezzsantos commented 3 months ago

Currently, the only way to refresh the tokens of an SSO provider after they expire or after the refresh token expires, is to authenticate again. This is fine if the only use of the provided tokens is authentication to the API for access, but what if those tokens need to be used in other adapters to access other services?

For example, suppose we provide an SSO provider for doing Microsoft Authentication. We eventually store the 3 tokens, access, refresh and id token in the backend. Then we build an another adapter in another part of the system, that needs to use these tokens to access another system, like office, or sharepoint?

We need to be able to query for those tokens and manage their lifecycle explictly if needed.

How do we: