Linux LDAP Agent Installation Fails with Error "Failed to fetch OAuth Codes from Okta; MismatchedInputException: No content to map due to end-of-input"
Last Updated:
Overview
During installation of the Linux LDAP Agent, the error below is displayed after validating the LDAP server configuration and installation fails:
Configuring Okta LDAP agent...
[ 2024-11-22 21:25:00.354 ] [ main ] [ INFO ] [LdapAgentRuntime:41] - Starting Okta LDAP Agent
[ 2024-11-22 21:25:00.392 ] [ main ] [ INFO ] [LdapAgentRuntime:63] - FIPS mode disabled
[ 2024-11-22 21:25:02.232 ] [ main ] [ INFO ] [LdapAgentConfigLoader:345] - Starting Device Authorization...
[ 2024-11-22 21:25:02.233 ] [ main ] [ INFO ] [LdapAgentConfigLoader:1072] - Saving Configuration to file: /opt/Okta/OktaLDAPAgent/conf/OktaLDAPAgent.conf
[ 2024-11-22 21:25:02.272 ] [ main ] [ INFO ] [LdapAgentConfigLoader:1081] - Saving Configuration successful
[ 2024-11-22 21:25:02.699 ] [ main ] [ ERROR ] [LdapAgentRuntime:92] - Agent encountered runtime error: message=Failed to authorize device, cause={}
com.okta.agent.AgentRuntimeException: Failed to authorize device
at com.okta.ldap_agent.config.LdapAgentConfigLoader.performStartDeviceAuthorization(LdapAgentConfigLoader.java:362)
at com.okta.ldap_agent.config.LdapAgentConfigLoader.setupOrStartAgent(LdapAgentConfigLoader.java:234)
at com.okta.ldap_agent.LdapAgentRuntime.main(LdapAgentRuntime.java:76)
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
at [Source: (byte[])""; line: 1, column: 0]
at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4821)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4723)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3738)
at com.okta.agent.api.http.RestClient.authorizeDevice(RestClient.java:474)
at com.okta.ldap_agent.config.LdapAgentConfigLoader.performStartDeviceAuthorization(LdapAgentConfigLoader.java:360)Applies To
- Linux
- LDAP Agent
Cause
When entering the base URL for the Okta organization earlier in the agent installation process, the admin URL was provided instead of the base URL. The base URL for an org is https://<org>.okta.com, while the admin URL appends "-admin" to the org name, such as https://<org>-admin.okta.com.
Solution
To correct this issue, modify the config file in the location displayed when the agent installer is first launched, as seen in the screenshot above. The URL entered during the initial installation attempt will be stored in that configuration file, and subsequent installation attempts will continue to use that value.
Edit the "orgURL" value to remove "-admin" and leave only the org's base URL.
Optionally, this file can also be deleted and will be rebuilt the next time the agent installer is run.
