IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Need help on implementing IRefreshTokenService interface

Open behrooz66 opened this issue 10 years ago • 4 comments

I just need a quick help to understand how can I properly implement the interface "IRefreshTokenService" in case I want to do some manipulation. This is the signature of the method: public Task CreateRefreshTokenAsync(ClaimsPrincipal subject, Token accessToken, Client client)

Can you please give me some simple sample on how to generate a valid refresh token in there?

Cheers, Behrooz

behrooz66 avatar Nov 30 '16 19:11 behrooz66

check the default implementation.

leastprivilege avatar Nov 30 '16 19:11 leastprivilege

I read through the default implementation and there is a tiny piece I cannot decipher, probably due to a missing piece in my programming knowledge. I wonder if you can give me a quick tip.

The _event is from the type IEventService which only contains one method called RaiseAsync. However, in refresh token service implementation, there is the following line:

_event.RaiseSuccessfulRefreshTokenRefreshEventAsync(....)

This "RaiseSuccessfulRefreshTokenRefreshEventAsync" is a method of another class called "IEventServiceExtensions" that does not event implement that "IEventService" interface! How does the _event then invoke a method in that class? I'm very confused and any help is appreciated.

behrooz66 avatar Dec 02 '16 18:12 behrooz66

it's an extension method

brockallen avatar Dec 02 '16 18:12 brockallen

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 15 '20 09:01 lock[bot]