Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Refresh token response does not contain custom fields from custom token request validator #1831

Closed
rukyoj opened this issue Dec 4, 2017 · 6 comments
Assignees
Labels
Milestone

Comments

@rukyoj
Copy link

rukyoj commented Dec 4, 2017

I have an implementation of ICustomTokenRequestValidator in which I add additional data in the custom response. So, when I make request for an access token (using password grant), I'm able to get my custom data in the response. But when I use use the refresh_token grant, I'm unable to get my custom response (even though the ValidateAsync method actually gets called. Is this a bug, or am I supposed to override something else?

@brockallen
Copy link
Member

I'm able to get my custom data in the response

What's an example of this custom data, and how in the custom token request validator are you setting this data to be included in the response?

@rukyoj
Copy link
Author

rukyoj commented Dec 4, 2017

public class CustomTokenRequestValidator : ICustomTokenRequestValidator
{
        public Task ValidateAsync(CustomTokenRequestValidationContext context)
        {
            context.Result.CustomResponse = new Dictionary<string, object>
            {
                {"scope", "read" }
            };

            return Task.CompletedTask;
        }
}

Response (with password grant):

{
    "access_token": "73ab04ed8b6e5a91de9129cd339485309f3706ee544cbe3a91aacd1cc034782e",
    "expires_in": 86400,
    "token_type": "Bearer",
    "refresh_token": "9f119581772cab814e956ca11e8c66f8877979d2589d9644c8f4f40e0fdb28df",
    "scope": "read"
}

Response (with refresh_token grant):

{
    "access_token": "9f119581772cab814e956ca11e8c66f8877979d2589d9644c8f4f40e0fdb28df",
    "expires_in": 86400,
    "token_type": "Bearer",
    "refresh_token": "9f119581772cab814e956ca11e8c66f8877979d2589d9644c8f4f40e0fdb28df"
}

@leastprivilege
Copy link
Member

OK - I can repro the problem. Need to have a closer look.

@leastprivilege leastprivilege changed the title ICustomTokenRequestValidator + Refresh Token Refresh token response does not contain custom fields from custom token request validator Dec 6, 2017
@leastprivilege
Copy link
Member

Found the bug. Will be included in the next bug fix release.

@leastprivilege
Copy link
Member

Thanks for reporting!

@leastprivilege leastprivilege added this to the 2.0.6 milestone Dec 6, 2017
@lock
Copy link

lock bot commented Jan 13, 2020

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 lock bot locked as resolved and limited conversation to collaborators Jan 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants