refs:
https://stackoverflow.com/questions/34517916/sending-additional-parameters-to-token-in-web-api-with-oauth2-and-angularjs
When using GrantResourceOwnerCredentials
, you can retrieve the OWIN request from OAuthGrantResourceOwnerCredentialsContext
and extract the custom parameter you need by calling ReadFormAsync()
.
public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
{
var form = await context.Request.ReadFormAsync();
if (string.Equals(form["remember"], "true", StringComparison.OrdinalIgnoreCase))
{
// Add custom logic to handle the "remember me" case.
}
}