Finally, I found the answer from this post :
owin oauth send additional parameters
in the ValidateClientAuthentication
we can add additional params
public override Task ValidateClientAuthentication(OAuthValidateClientAuthenticationContext context)
{
// other code ...
var grantClaims = context.Parameters.Get("grant_claims");
// other code ...
context.OwinContext.Set<string>("grant_claims", grantClaims);
// other code ...
}
then get the values in the authentication and refresh token methods
// auth
public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
{
var grantClaims = context.OwinContext.Get<string>("grant_claims");
}
//refresh token
public override async Task GrantRefreshToken(OAuthGrantRefreshTokenContext context)
{
var grantClaims = context.OwinContext.Get<string>("grant_claims");
}