I have a problem with Okta Widget and localhost.
I can login through Okta Widget only if I use localhost in domain.
The problem I have is, that our solution to work on localhost need custom localhost domain and not localhost. If I go through localhost, not all functionalities works in the application.
When I try to use the custom domain on Okta it sends me an error back:
AuthSdkError: PKCE requires a modern browser with encryption support running in a secure context.
The current page is not being served with HTTPS protocol. PKCE requires secure HTTPS protocol.
I understand that it is http and not https but it is possible to somehow work around it?
I have seen that I should be able to turn off PKCE by adding these options to my widget config:
I believe it is because PKCE flow requires secure context.
Locally-delivered resources such as those with http://127.0.0.1 URLs, http://localhost and http://*.localhost URLs (e.g. http://dev.whatever.localhost/ ), and file:// URLs are also considered to have been delivered securely.
What error do you encounter when you attempt to disable PKCE?
var searchParams = new URL(window.location.href).searchParams;
oktaConfig.otp = searchParams.get(āotpā);
oktaConfig.state = searchParams.get(āstateā);
const oktaSignIn = new OktaSignIn(oktaConfig);
My Okta Widget error:
{
āerrorSummaryā: āPKCE requires a modern browser with encryption support running in a secure context.\nThe current page is not being served with HTTPS protocol. PKCE requires secure HTTPS protocol.ā,
āerrorCodeā: āINTERNALā,
āerrorLinkā: āINTERNALā,
āerrorIdā: āINTERNALā,
āerrorCausesā: ,
ānameā: āAuthSdkErrorā
}