Our service uses OAuth to issue refresh-tokens that 3rd-party applications can later use to access users' resources without the presence of the user (server to server). We currently use Authorization Code flow and require the apps' developers to store refresh tokens per each user on their side, and use the refresh token to generate a short-lived access token that they can then use to access the user's resources. This works fine.
However, implementing this flow isn't easy for app developers. They have to implement all required redirects, and store many tokens securely on their side.
I'm trying to understand if the following approach has any security or other flaws that I miss:
- After the user's consent to install the app, our authorization server will store the fact that the specific permissions were granted by the user.
- The UI will redirect to a provided URL, so the app has a chance to ask the user to login or create an account. However, there will be no need for the app to store refresh token.
- The app will have to store the fact that a user's account on their side is connected to a user's account on our side.
- When the app wants to make a server-to-server request to our service, they will use client-credentials in order to authenticate itself, and will request a short-lived access-token scoped to the user's account resources. This is equivalent to using the refresh-token in the existing authorization code flow.
- The authorization server will check its records to decide if such access-token may be provided, and return it to the client.
- The client will call the resource server using the access-token just as it does today.
Basically this approach eliminates the need to manage refresh tokens by the clients, and the need to implement all the different redirects implied by oauth. In addition, it allows tokens revocation very easily, because all grant-consents are stored on the authorization server.
Do I miss anything? Any reason not to use this approach?
Note: This question is similar, but it asks about an internal super-powered app.