I have created a service, without user interaction, to access my API. The Api needs to know the user. Therefore I need the resource-owner flow.
For accessing my Api I need an access_token with the correct scope "MyApiScope". I can obtain an access_token with the resource-owner flow specifying scope="MyApiScope". But I won't get a refresh token in this way.
I can obtain a refresh_token with the resource-owner flow specifying scope="offline_access". But the access_tokens generated with this refresh token can't be used to access my Api because they do not contain the right scope, "offline_access" != "MyApiScope".
Is it just not possible in this scenario to use refresh tokens and should I therefore always use the username/password to obtain a new access_token?
Thanks for your advice.
offline_accessandMyApiScopescopes - Spomky-Labsgrant_type=password&username={USERNAME}&password={PASSWORD}&client_id={CLIENT_ID}&client_secret={CLIENT_SECRET}&scope=MyApiScope offline_access- fantastischIdee