Getting Parse Exception when trying to do CURL

We were trying to evaluate OKTA for my organization. We have created a developer account and apiToken and when we try to access the user apis, like get user using the following CURL

curl -v -X GET \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: SSWS {apiToken}" \

We get the response back , but when i try to parse that response, i see there is an issue in parsing it.

This is the response we got: Pasting the response which seems to be the issue.

	"profile": {
		"recovery_question":{"question":"What is the food you least liked as a child?"},
**				"href":"* Connection #0 to host left intact gjupe1QmYh9eS0h7/credentials/forgot_password","method":"POST"**
**			},**

In the forgot password element, we see there is a string "* Connection #0 to host left intact "

Because when we try to invoke the same api thru the java application, we get the same parse error.

2018-12-20 11:32:58,072 ERROR [] [] Error in getUser() :::: com.okta.sdk.impl.ds.MarshalingException: Unable to convert InputStream String to Map.
	at com.okta.sdk.impl.ds.JacksonMapMarshaller.unmarshal(
	at com.okta.sdk.impl.ds.DefaultDataStore.getBody(
	at com.okta.sdk.impl.ds.DefaultDataStore.execute(
	at com.okta.sdk.impl.ds.DefaultDataStore.lambda$getResourceData$0(
	at com.okta.sdk.impl.ds.DefaultFilterChain.filter(

Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: (ByteArrayInputStream); line: 1, column: 2]
	at com.fasterxml.jackson.core.JsonParser._constructError(
	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(

Can you please let us know, how to resolve this?

Parse error on line 1:
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'

That is very weird. Are you seeing this consistently on more than one user?

Hi Nate,

Looks like it is not the issue with the API response. I misread the exceptions while i was calling the OKTA user apis. When I used the trace to debug the exceptions, I found out the reason for the parsing issue. instead of providing the {oktadomainurl}, I have provided the {oktadomainurl}/oauth2/default while creating the Client Object. That was the reason I was getting the marshalling exceptions.

Once i have corrected that, I didn’t see any issue calling the user APIs.

Thanks for your response and appreciate it.

1 Like

Cool, glad you figured it out!