-
Notifications
You must be signed in to change notification settings - Fork 320
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
🌱 Adds Custom Factor #484
🌱 Adds Custom Factor #484
Conversation
12fd476
to
e6d035c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some comments
package.json
Outdated
@@ -89,6 +89,7 @@ | |||
"webpack": "1.13.1" | |||
}, | |||
"dependencies": { | |||
"@okta/i18n": "45.3.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be removed, same with the changes to package-lock.json
. We don't need i18n as a dependency, the contents we need are in packages
folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
src/VerifyCustomFactorController.js
Outdated
* See the License for the specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
/* eslint camelcase: 0 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this? Couldn't find it...
label: '', | ||
description: 'factor.customFactor.description', | ||
iconClassName: 'mfa-custom-factor', | ||
sortOrder: 15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we confirm with Alex about the order of custom factor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirmed, should be last
src/models/AppState.js
Outdated
if (!res._links || !res._links.next || !res._links.next.href) { | ||
return null; | ||
} | ||
return res._links.next.href; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should check that the name
of the link is redirect
, so we are sure it is a url redirect and not any other next
link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good.
Can you add a screenshot please?
Missing is one comment to confirm about the order of this custom factor, and the tests.
9edfd4f
to
26552d0
Compare
'enrollCustomFactorRedirectUrl': { | ||
deps: ['lastAuthResponse'], | ||
fn: function (res) { | ||
if (!res._links || !res._links.next || res._links.next.name !== 'activate' || !res._links.next.href) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this link should also be named redirect
in our APIs, since this factor is very different to the other ones we currently support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AjayThomas-okta thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed, we will revisit this link name later.
"status": 200, | ||
"responseType": "json", | ||
"response": { | ||
"stateToken": "00M2MpKONl8k_a3oRjwDcznNy6NKeNfb0lkKLUjDVG", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should be a string with testStateToken
or something similar, no need for this token here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 sorry, forgot to change
}, | ||
"_links":{ | ||
"next":{ | ||
"name":"activate", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this not redirect
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,13 @@ | |||
define({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rename this file to CUSTOM_FACTOR_error
?
And also, do we need this file? it seems to be a generic error, so we might have already another file that we can use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error is in specific files like SMS verify and resend.. Maybe we can use RECOVERY_error.js? If not, i'll rename this file to something more generic
return setup().then(function (test) { | ||
test.setNextResponse(responseSuccess); | ||
expect(test.form.titleText()) | ||
.toBe('GENERIC_SAML'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we change the vendorName
in the test xhr files to be something different than the provider? So we can test we are displaying the correct name. Maybe something like Third Party Factor
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok 👍
@gowthamidommety-okta Can you add video? |
4aeb4a7
to
4fc4cf4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, just some nits. After fixing those this is great ⛵️
'enrollCustomFactorRedirectUrl': { | ||
deps: ['lastAuthResponse'], | ||
fn: function (res) { | ||
if (!res._links || !res._links.next || res._links.next.name !== 'activate' || !res._links.next.href) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed, we will revisit this link name later.
"_links": { | ||
"next": { | ||
"name": "redirect", | ||
"href": "http://rain.okta1.com:1802/policy/mfa-idp-redirect?okta_key=mfa.redirect.00opis8DrVkQCV2LL0g3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's change this to http://rain.okta1.com:1802/policy/mfa-idp-redirect?okta_key=mfa.redirect.id
, same in ENROLL_ACTIVATE
"profile": {"user":"administrator1@clouditude.net"}, | ||
"_links": { | ||
"verify": { | ||
"href":"http://rain.okta1.com:1802/api/v1/authn/factors/smlqwtL7uk8z7ikG80g3/verify", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here, we should have http://rain.okta1.com:1802/api/v1/authn/factors/customFactorId/verify
. Same comment for the other MFA_REQUIRED file
return setup().then(function (test) { | ||
test.setNextResponse(responseSuccess); | ||
expect(test.form.titleText()) | ||
.toBe('Third Party Factor'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no need here for a new line I think. It could be in the same line 88
src/models/AppState.js
Outdated
@@ -187,6 +187,12 @@ function (Okta, Q, Factor, BrowserFeatures, Errors) { | |||
return res.status === 'MFA_ENROLL'; | |||
} | |||
}, | |||
'isMfaEnrollActivate': { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method already exists, look below right after isMfaTimeout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, will remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
c1fc688
to
813e611
Compare
Resolves: OKTA-169502
813e611
to
67ac268
Compare
Resolves: OKTA-169502
Enroll Flow using another okta org as an idp:
Verify Flow using another okta org as an idp: