I've followed the instructions here to implement an OAuth2 (not OIDC) provider from scratch https://backstage.io/docs/auth/oidc
It's working, but the authorization only persists until refresh. Note that I added "ProfileInfoApi & BackstageIdentityApi & SessionApi" as types in the ref so that I could add it as an Authentication Provider in the user settings, but I don't know that it's actually compatible with those types. Is there something I'm missing?
StackExchange does proivide a "no_expiry" scope, but adding that scope has made no difference.