static TokenResponse RequestToken() { var client = new OAuth2Client( new Uri(Constants.TokenEndpoint), "customclient", "secret"); var customParameters = new Dictionary<string, string> { { "custom_credential", "custom credential"} }; return client.RequestCustomGrantAsync("custom", "read write", customParameters).Result; }
static void Main(string[] args) { var client = new OAuth2Client( new Uri("https://localhost:44333/core/connect/token"), "client", "secret"); var customParams = new Dictionary<string, string> { { "some_custom_parameter", "some_value" } }; var result = client.RequestCustomGrantAsync("custom", "read", customParams).Result; ShowResponse(result); }
static void Main(string[] args) { var client = new OAuth2Client( new Uri("http://localhost:3333/core/connect/token"), "client", "secret"); var result = client.RequestCustomGrantAsync("legacy_account_store", "read", new Dictionary<string, string> { { "account_store", "foo" }, { "legacy_id", "bob" }, { "legacy_secret", "bob" } }).Result; ShowResponse(result); }