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

🌱 Adds Custom Factor #484

Conversation

gowthamidommety-okta
Copy link
Contributor

@gowthamidommety-okta gowthamidommety-okta commented Jun 14, 2018

Resolves: OKTA-169502

Enroll Flow using another okta org as an idp:

customfactorenroll

Verify Flow using another okta org as an idp:

customfactorverify

Copy link
Contributor

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",

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

* See the License for the specific language governing permissions and limitations under the License.
*/

/* eslint camelcase: 0 */

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

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmed, should be last

if (!res._links || !res._links.next || !res._links.next.href) {
return null;
}
return res._links.next.href;

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

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.

'enrollCustomFactorRedirectUrl': {
deps: ['lastAuthResponse'],
fn: function (res) {
if (!res._links || !res._links.next || res._links.next.name !== 'activate' || !res._links.next.href) {

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AjayThomas-okta thoughts?

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",

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

Copy link
Contributor Author

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",

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?

Copy link
Contributor Author

@gowthamidommety-okta gowthamidommety-okta Jun 26, 2018

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({

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

Copy link
Contributor Author

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');

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok 👍

@srinivasanagandla-okta
Copy link

@gowthamidommety-okta Can you add video?

Copy link
Contributor

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) {

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",

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",

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');

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

@@ -187,6 +187,12 @@ function (Okta, Q, Factor, BrowserFeatures, Errors) {
return res.status === 'MFA_ENROLL';
}
},
'isMfaEnrollActivate': {

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, will remove

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@gowthamidommety-okta gowthamidommety-okta force-pushed the gd-OKTA-169502-customFactor branch 2 times, most recently from c1fc688 to 813e611 Compare June 28, 2018 00:14
Resolves: OKTA-169502
@gowthamidommety-okta gowthamidommety-okta removed the request for review from AjayThomas-okta June 28, 2018 19:02
@gowthamidommety-okta gowthamidommety-okta merged commit 975ceb8 into okta:master Jun 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants