Hello, I am working on custom integrations with apps with Okta, I’m a little new to the system so I’m still working out all the details, I am working on code that is suppost to send me to an authentication server through a widget (Single Page App, PKCE required and implicit is enabled in grant type) but I keep getting the error “The requested feature is not enabled in this enviroment” been trying for a few days to fix this with no dice. Here is my code below:
<!doctype html>
Simple Web Page h1 { margin: 2em 0; }<div class="container">
<div id="okta-login-container"></div>
</div>
<script type="text/javascript">
var oktaSignIn = new OktaSignIn({
baseUrl: “https://MYid.okta.com”,
clientId: “clientID”,
authParams: {
issuer: “https://MYid.okta.com/oauth2/default”,
responseType: [‘token’, ‘id_token’],
display: ‘page’
}
});
if (oktaSignIn.token.hasTokensInUrl()) {
oktaSignIn.token.parseTokensFromUrl(
// Interact with authentication server if they attempt to sign in.
function success(res) {
var accessToken = res[0];
var idToken = res[1];
oktaSignIn.tokenManager.add('accessToken', accessToken);
oktaSignIn.tokenManager.add('idToken', idToken);
window.location.hash='';
},
function error(err) {
console.error(err);
}
);
} else {
oktaSignIn.session.get(function (res) {
// Let use know of active user sessin if they’re still logged in.
if (res.status === ‘ACTIVE’) {
document.getElementById(“messageBox”).innerHTML = "Hello, " + res.login + “! You are still logged in! :)”;
return;
}
// If the user is not logged in, then render new login widget.
oktaSignIn.renderEl(
{ el: ‘#okta-login-container’ },
function success(res) {},
function error(err) {
console.error(err);
}
);
});
}