Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created March 12, 2024 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/cdc6e7ae0b6d392785b4f0bb7dff44d1 to your computer and use it in GitHub Desktop.
Save bjoerntx/cdc6e7ae0b6d392785b4f0bb7dff44d1 to your computer and use it in GitHub Desktop.
private async Task RequestCodeAsync()
{
string clientId = "";
string serviceUrl = "https://trial.dsserver.io";
HttpClient client = new HttpClient();
var queryParams = new Dictionary<string, string>
{
["response_type"] = "code",
["scope"] = "signature",
["client_id"] = clientId,
["redirect_uri"] = "https://localhost:7194/Home/Token",
["state"] = "teststate",
};
string requestUri = $"{serviceUrl}/oauth/authorize?{UrlEncode(queryParams)}";
var codeRequest = new HttpRequestMessage(HttpMethod.Get, requestUri);
await client.SendAsync(codeRequest);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment