public string CreateAuthorizationUrl(OAuth2Type responseType, string state = null)
{
var queryStrings = new Dictionary<string, string> { { "client_id", ClientId } };
if (state != null) queryStrings.Add("state", state);
OAuthType = responseType;
switch (responseType)
{
case OAuth2Type.Code:
queryStrings.Add("response_type", "code");
break;
case OAuth2Type.Token:
queryStrings.Add("response_type", "token");
break;
case OAuth2Type.Pin:
queryStrings.Add("response_type", "pin");
break;
default:
throw new InvalidOperationException();
}
return queryStrings.ToQueryString(AuthorizationEndpoint);
}