Closed mastrup closed 12 months ago
I think at that point it's necessary to go back into the backoffice and manually request another token. As without a refresh token, we would require the user to log into their account and accept the permissions before another access token would be issued.
Maybe there's some UI improvements we could consider here to make it a little more obvious when a token is expiring. But I'm not sure it's possible to handle in an automated way without user involvement. Open to suggestions though if you had an idea how this could work.
As I understand, Client Credentials is meant for applications to obtain an access token outside of the context of a user.
It seems a bit counterintuitive that a user must actively request a new token when using Client Credentials as authentication method.
Ideally Umbraco.AuthorizedServices
should just request a new token like it would for a refresh token, when using Client Credentials.
That's a good point... I'd missed that you were using the client credentials flow. We'll see what we can do as it does seem we've missed a part in this implementation.
Sounds great! Thank you for looking into it.
You should find this resolved as part of the 0.4.0 release, which I've just pushed out to NuGet.
This is great! Thanks Andy!
Umbraco version: 12.3.1 Umbraco.AuthorizedServices version: 0.3.1
Issue
I have added a new service, using
OAuth2ClientCredentials
. My defined service looks like this:When requesting a token from the endpoint, I get the following response:
Everything works fine up until my returned token expires. I would expect
Umbraco.AuthorizedServices
to just fetch a new token, but I am getting the following response in Umbraco, when I clickVerify Sample Request
:Looking at EnsureAccessToken(), it seems that my token always will get cleared when I don't have a refresh token present.
How would I go about fetching a fresh token before my token expires or when it has expired?