title: Web API authentication response properties
body: <p>I am developing a web service using ASP.NET Web API. I am using ASP.NET Identity for authentication and token generation. I need to return an extended property in token response json. Till now I am able to return an extended string property in which I am sending a json string obtained by serializing a custom class object into json. Following is my auth provider code:</p>
  
  <pre><code>public class ApplicationOAuthProvider : OAuthAuthorizationServerProvider
  {
      public override async Task ValidateClientAuthentication(OAuthValidateClientAuthenticationContext context)
      {
          await Task.Run(() =&gt;
          {
              context.Validated();
          });            
      }
  
      public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
      {
          await Task.Run(() =&gt;
          {
              var loginResponse = new AccountManager().Login(context.UserName, context.Password);
  
              if (loginResponse == null)
              {
                  context.SetError("invalid_grant", Resources.Messages.InvalidGrant);
                  return;
              }
  
              var identity = new ClaimsIdentity(context.Options.AuthenticationType);
  
              IDictionary&lt;string, string&gt; data = new Dictionary&lt;string, string&gt;
              {
                  { "userData", JsonConvert.SerializeObject(loginResponse) }
              };
              AuthenticationProperties properties = new AuthenticationProperties(data);
  
              Microsoft.Owin.Security.AuthenticationTicket ticket = new Microsoft.Owin.Security.AuthenticationTicket(identity, properties);
              context.Validated(ticket);
          });            
      }
  
      public override Task TokenEndpoint(OAuthTokenEndpointContext context)
      {
          foreach (KeyValuePair&lt;string, string&gt; property in context.Properties.Dictionary)
          {
              context.AdditionalResponseParameters.Add(property.Key, property.Value);
          }
  
          return Task.FromResult&lt;object&gt;(null);
      }
  }
  </code></pre>
  
  <p>Now in my response I have a property e.g. <code>"userData" : "&lt;Json String&gt;"</code> whereas I wanted to assign a json object (not json string) to userData. Is it possible?</p>