Exemple #1
0
 public string CreateAuthenticationUrl(List <string> scopes = null)
 => $"https://login.eveonline.com/oauth/authorize/?response_type=code&redirect_uri={Uri.EscapeDataString(_config.CallbackUrl)}&client_id={_config.ClientId}{((scopes != null) ? $"&scope={string.Join(" ", scopes)}" : "")}";
Exemple #2
0
        public string CreateAuthenticationUrl(List <string> scopes = null, string state = "")
        {
            string authVersion = string.Empty;

            switch (_config.AuthVersion)
            {
            case AuthVersion.v2:
                authVersion = "/v2";
                break;
            }

            return($"{_ssoUrl}{authVersion}/oauth/authorize/?response_type=code&redirect_uri={Uri.EscapeDataString(_config.CallbackUrl)}&client_id={_config.ClientId}{((scopes != null) ? $"&scope={string.Join(" ", scopes)}" : "")}{((scopes != null) ? $"&scope={string.Join(" ", scopes)}" : "")}{((state != null) ? $"&state={state}" : "")}");
        }
 public string CreateAuthenticationUrl(List <string> scopes = null, string state = "0")
 {
     if (_config.AuthVersion == AuthVersion.v1)
     {
         return($"{_ssoUrl}/oauth/authorize/?response_type=code&redirect_uri={Uri.EscapeDataString(_config.CallbackUrl)}&client_id={_config.ClientId}{((scopes != null) ? $"&scope={string.Join(" ", scopes)}" : "")}&state={Uri.EscapeDataString(state)}");
     }
     else if (_config.AuthVersion == AuthVersion.v2)
     {
         return($"{_ssoUrl}/v2/oauth/authorize/?response_type=code&redirect_uri={Uri.EscapeDataString(_config.CallbackUrl)}&client_id={_config.ClientId}{((scopes != null) ? $"&scope={string.Join(" ", scopes)}" : "")}&state={Uri.EscapeDataString(state)}");
     }
     else
     {
         throw new NotImplementedException($"Supplied auth version has not been implemented in {nameof(CreateAuthenticationUrl)}.");
     }
 }