<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
System Status
Announcements
Announcements
Search
Search
Select Language

Embedded Login Failure with "AuthSdkError: Malformed Token" in Okta OIDC Applications

Okta Classic Engine
Okta Identity Engine
SDKs & Libraries

Overview

Frontend OpenID Connect (OIDC) applications using embedded login via Sign In Widget or okta-auth-js fail after a user completes all authentication steps, producing an AuthSdkError: Malformed token error in the browser developer console. The Custom Authorization Server used by the application has Access Token Encryption enabled, which is incompatible with public frontend applications. Removing token encryption from the Authorization Server, or pointing the application to an Authorization Server without encryption enabled, resolves the issue.

Applies To

  • Okta Identity Engine (OIE)
  • Okta Classic Engine
  • Embedded Authentication
  • Sign In Widget / okta-auth-js
  • OIDC Applications
  • JSON Web Encryption (JWE)

Cause

The Custom Authorization Server used by the application has Access Token Encryption enabled. Public frontend applications cannot securely store a private key, so Okta is unable to decrypt the token, producing the AuthSdkError: Malformed token error.

application has enabled Access Token Encryption

Solution

Removing Token Encryption from the Authorization Server

Remove token encryption from the Custom Authorization Server to restore embedded login functionality.

  1. Navigate to the Custom Authorization Server that the application uses.
  2. Disable Access Token Encryption on the Authorization Server.

NOTE: JSON Web Encryption (JWE) of either access_token or id_token is not intended for public frontend applications. It requires the client to securely store a private key, which public applications cannot do.

How is the Application Pointed to a Non-Encrypting Authorization Server?

Point the application to an Authorization Server that does not have encryption enabled as an alternative to disabling encryption on the existing server.

  1. Identify an Authorization Server in the Okta Admin Console that does not have Access Token Encryption enabled.
  2. Update the application configuration to reference that Authorization Server.

Related References

Loading
Embedded Login Failure with "AuthSdkError: Malformed Token" in Okta OIDC Applications | Okta Support