ServiceManager.Admin.WhoAmI throws exception in TestApi sample application
I'm unable to connect to our gemini instance using the TestApi sample application.
I get an Exception : Unknown error, status code: Unauthorized
at Countersoft.Gemini.Api.BaseService.GetResponse[T](IRestRequest request) at Countersoft.Gemini.Api.BaseService.WhoAmI() at Test.FormLogin.btnOKClick1(Object sender, EventArgs e) in ..\Dev\ContersoftGeminiExamples\Samples\FormLogin.cs:line 29
The gemini instance is hosted in IIS 7.5, it isn't behind a firewall
If i try connecting using Windows Authentication: login = new ServiceManager("http://gemini", "domain\username", "", "", true);
I get a RestException : Unauthorized
If i try connection using UserName\Password with apiKey : login = new ServiceManager("http://gemini", "domain\username", "password", "apiKey", false);
I get an Exception : Unknown error, status code: Unauthorized at Countersoft.Gemini.Api.BaseService.GetResponse[T](IRestRequest request) at Countersoft.Gemini.Api.BaseService.WhoAmI() at Test.FormLogin.btnOKClick1(Object sender, EventArgs e) in ..\Dev\ContersoftGeminiExamples\Samples\FormLogin.cs:line 31
User59373
· 1 |
|
Wednesday, December 12, 2012, 2:08:44 PM |
0
|
Is the windows user that you are running under matches the user specified in code? |
||||
|
0
|
This is what I'm getting
Gives: Unknown error, status code: Unauthorized at Countersoft.Gemini.Api.BaseService.GetResponse[T](IRestRequest request) at Countersoft.Gemini.Api.BaseService.WhoAmI() at Test.Program.WhoAmId(String url, String username, String password, String apiKey, Boolean windowsAuthentication) in ..\Dev\ContersoftGeminiExamples\Samples\Program.cs:line 53 Unknown error, status code: Unauthorized at Countersoft.Gemini.Api.BaseService.GetResponse[T](IRestRequest request) at Countersoft.Gemini.Api.BaseService.WhoAmI() at Test.Program.WhoAmId(String url, String username, String password, String apiKey, Boolean windowsAuthentication) in ..\Dev\ContersoftGeminiExamples\Samples\Program.cs:line 53 Unknown error, status code: Unauthorized at Countersoft.Gemini.Api.BaseService.GetResponse[T](IRestRequest request) at Countersoft.Gemini.Api.BaseService.WhoAmI() at Test.Program.WhoAmId(String url, String username, String password, String apiKey, Boolean windowsAuthentication) in ..\Dev\ContersoftGeminiExamples\Samples\Program.cs:line 53 Unauthorized Unauthorized Unknown error, status code: Unauthorized at Countersoft.Gemini.Api.BaseService.GetResponse[T](IRestRequest request) at Countersoft.Gemini.Api.BaseService.WhoAmI() at Test.Program.WhoAmId(String url, String username, String password, String apiKey, Boolean windowsAuthentication) in ..\Dev\ContersoftGeminiExamples\Samples\Program.cs:line 53 Unknown error, status code: Unauthorized at Countersoft.Gemini.Api.BaseService.GetResponse[T](IRestRequest request) at Countersoft.Gemini.Api.BaseService.WhoAmI() at Test.Program.WhoAmId(String url, String username, String password, String apiKey, Boolean windowsAuthentication) in ..\Dev\ContersoftGeminiExamples\Samples\Program.cs:line 53 Unknown error, status code: Unauthorized at Countersoft.Gemini.Api.BaseService.GetResponse[T](IRestRequest request) at Countersoft.Gemini.Api.BaseService.WhoAmI() at Test.Program.WhoAmId(String url, String username, String password, String apiKey, Boolean windowsAuthentication) in ..\Dev\ContersoftGeminiExamples\Samples\Program.cs:line 53 Unknown error, status code: Forbidden at Countersoft.Gemini.Api.BaseService.GetResponse[T](IRestRequest request) at Countersoft.Gemini.Api.BaseService.WhoAmI() at Test.Program.WhoAmId(String url, String username, String password, String apiKey, Boolean windowsAuthentication) in ..\Dev\ContersoftGeminiExamples\Samples\Program.cs:line 53 Unknown error, status code: Forbidden at Countersoft.Gemini.Api.BaseService.GetResponse[T](IRestRequest request) at Countersoft.Gemini.Api.BaseService.WhoAmI() at Test.Program.WhoAmId(String url, String username, String password, String apiKey, Boolean windowsAuthentication) in ..\Dev\ContersoftGeminiExamples\Samples\Program.cs:line 53 |
||||
|
0
|
Are you running Gemini using windows authentication in the web.config file? If so, did you disable anonymous access in IIS? |
||||
|
0
|
the site is configured to use windows authentication and anonymous access is disabled. |
||||
|
0
|
Can you please use Fiddler to see if the response is from IIS or Gemini? |
||||
|
0
|
ANSWER
Ok, this is a bug in 5.1.3, which we are fixing for 5.1.5 (due out next week). |
||||
|
0
|
Note that it is only the WhoAmI method that has this issue. You should still be able to use the api. |
||||
|
0
|
I get the same issues when trying to get a list of users:
Unknown error, status code: Unauthorized at Countersoft.Gemini.Api.BaseService.GetResponse[T](IRestRequest request) at Countersoft.Gemini.Api.UserService.GetUsers() at Test.Program.DoSomething(String url, String username, String password, String apiKey, Boolean windowsAuthentication) in ..\Dev\ContersoftGeminiExamples\Samples\Program.cs:line 38 Unknown error, status code: Unauthorized at Countersoft.Gemini.Api.BaseService.GetResponse[T](IRestRequest request) at Countersoft.Gemini.Api.UserService.GetUsers() at Test.Program.DoSomething(String url, String username, String password, String apiKey, Boolean windowsAuthentication) in ..\Dev\ContersoftGeminiExamples\Samples\Program.cs:line 38 Unknown error, status code: Unauthorized at Countersoft.Gemini.Api.BaseService.GetResponse[T](IRestRequest request) at Countersoft.Gemini.Api.UserService.GetUsers() at Test.Program.DoSomething(String url, String username, String password, String apiKey, Boolean windowsAuthentication) in ..\Dev\ContersoftGeminiExamples\Samples\Program.cs:line 38 Unauthorized Unauthorized |
||||
|
0
|
You need to be a Gemini Administrator to do that. |
||||
|
0
|
Excellent! Looks like I'm up and running. Thanks for your assistance. |
||||
|