Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposed fix #3717

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"build:rollup-release": "rollup -c rollup.release.config.js",
"build:webpack-dev": "webpack --config webpack.dev.config.js",
"build:webpack-release": "webpack --config webpack.release.config.js",
"start": "node scripts/buildtools start",
"start": "DISABLE_CSP=1 OKTA_SIW_HOST=0.0.0.0 node scripts/buildtools start",
"start:ie11": "IE11_COMPAT_MODE=true OKTA_SIW_HOST=0.0.0.0 DISABLE_CSP=1 ENTRY=default yarn start --watch",
"start:test:app": "yarn workspace @okta/test.app start",
"mock:device-authenticator": "MOCK_SPEC_DIR_NAME=spec-device-authenticator MOCK_SERVER_PORT=6512 node ./playground/mocks/server.js",
Expand Down
1 change: 1 addition & 0 deletions playground/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<title>Okta Sign-in Widget Playground</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="referrer" content="origin" />
<link href="/css/okta-sign-in.css" type="text/css" rel="stylesheet" />
<link href="/css/okta-plugin-a11y.css" type="text/css" rel="stylesheet" />
<link href="/css/fonts.css" type="text/css" rel="stylesheet" />
Expand Down
6 changes: 4 additions & 2 deletions playground/mocks/config/responseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const idx = {
],

'/idp/idx/introspect': [
'identify',
// 'identify',
'authenticator-verification-idp'
// 'error-identify-multiple-errors',
// 'authenticator-enroll-ov-qr-enable-biometrics',
// 'authenticator-verification-okta-verify-push',
Expand Down Expand Up @@ -1155,5 +1156,6 @@ const redirectOnPoll = {
};

module.exports = {
mocks: idx
// mocks: idx
mocks: smartCardEnrollOrVerify
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"id": "0oa69chx4bZyx8O7l0g4",
"name": "IDP Authenticator"
},
"href": "http://localhost:3000/sso/idps/0oa69chx4bZyx8O7l0g4?stateToken=02TptqPN4BOLIwMAGUVLPlZVJEnONAq7xkg19dy6Gk",
"href": "http://10.0.2.2:3000/sso/idps/0oa69chx4bZyx8O7l0g4?stateToken=02TptqPN4BOLIwMAGUVLPlZVJEnONAq7xkg19dy6Gk",
"method": "GET",
"relatesTo" : [ "$.currentAuthenticatorEnrollment" ]
},
{
"rel": [ "create-form" ],
"name": "select-authenticator-authenticate",
"href": "http://localhost:3000/idp/idx/challenge",
"href": "http://10.0.2.2:3000/idp/idx/challenge",
"method": "POST",
"accepts": "application/json; okta-version=1.0.0",
"produces": "application/ion+json; okta-version=1.0.0",
Expand Down Expand Up @@ -118,7 +118,7 @@
"cancel": {
"rel": [ "create-form" ],
"name": "cancel",
"href": "http://localhost:3000/idp/idx/cancel",
"href": "http://10.0.2.2:3000/idp/idx/cancel",
"method": "POST",
"value": [
{
Expand Down
19 changes: 19 additions & 0 deletions src/v2/view-builder/views/idp/BaseIdpAuthenticator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BaseForm } from '../../internals';
import BaseAuthenticatorView from 'v2/view-builder/components/BaseAuthenticatorView';
import Util from 'util/Util';

export const BaseIdPAuthenticatorBody = BaseForm.extend({
initialize() {
Expand All @@ -12,6 +13,24 @@ export const BaseIdPAuthenticatorBody = BaseForm.extend({
export const BaseIdpAuthenticatorView = BaseAuthenticatorView.extend({
postRender() {
BaseAuthenticatorView.prototype.postRender.apply(this, arguments);

// OKTA-791813 - custom idp redirect fails during OV enrollment within Android OV webview
// in some situations the OV enrollment redirect-idp contains more than 1 remediation and therefore will
// be converted to a `challenge-authenticator` remediation rather than the usual `success-redirect`. In
// these situations a button needs to be rendered regardless
if (Util.isAndroidOVEnrollment()) {
this.$('.o-form-button-bar').hide();
const currentViewState = this.options.appState.getCurrentViewState();
this.add(createButton({
className: 'button button-primary',
title: loc('oform.verify', 'login'), // TODO: check with design to determine best button title (how would a customer change it)
id: 'launch-enrollment-ov',
click: () => {
Util.redirectWithFormGet(currentViewState.href);
}
}));
}

// get the error messages
const messages = this.options.appState.get('messages') || {};
// In case of failure, don't auto-redirect which will result in infinite redirects.
Expand Down