Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elli.Api.OAuth.Client.ApiException : Unexpected character encountered while parsing value: <. Path '', line 0, position 0. #20

Open
ryanxjohnson opened this issue Sep 27, 2018 · 5 comments

Comments

@ryanxjohnson
Copy link

Hello,

When trying to retrieve the access token I get this exception with the below stack trace:

Client Code:

            var credentials = new UserCredential
            {
                Password = "MyPassword",
                IdentityType = IdentityType.Lender,
                InstanceId = "MyInstanceId",
                UserName = "MyUserName",
            };

            ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;

            var accessToken = AccessToken.GetAccessToken(credentials);

StackTrace:

Elli.Api.OAuth.Client.ApiException : Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
   at Elli.Api.OAuth.Client.ApiClient.Deserialize(IRestResponse response, Type type)
   at Elli.Api.OAuth.Api.TokenApi.GenerateTokenWithHttpInfo(String grantType, String username, String password, String scope, String redirectUri, String code, String session)
   at Elli.Api.Base.AccessToken.GetAccessToken(UserCredential credentials, String apiClientId, String clientSecret)
@paulmoseley
Copy link

paulmoseley commented Sep 27, 2018 via email

@ryanxjohnson
Copy link
Author

Thank you for the quick reply @paulmoseley .

I url encoded the secret as well as the password, but I am still getting the same exception. It seems to do the API web request, but can't deserialize the response correctly.

Should the Authorization header have a space in the value? ie "Basic "

Also in the config file I noticed the apiHost value I got from this repo has "https://api.elliemae.com.com". Should the value be "https://api.elliemae.com" instead? Not sure if this is a typo.

If I do the same API call with "https://api.elliemae.com" I get this APIException (below) so I'm not sure if I'm dealing with an actual authentication issue or some parsing issue in the deserializer.

Elli.Api.OAuth.Client.ApiException: 'Error calling GenerateToken: {"error_description":"Invalid client or client credentials","error":"invalid_client"}
'

Thanks again.

@paulmoseley
Copy link

paulmoseley commented Sep 27, 2018 via email

@ryanxjohnson
Copy link
Author

Thank you for clearing up the URL issue. That helped narrow down the issue to an actual authentication error with our token, which we have now resolved.

This issue can be closed!

@Ellie-cpawar
Copy link
Contributor

@ryanxjohnson
Can you please close this issue if resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants