Skip to content
This repository was archived by the owner on Feb 14, 2019. It is now read-only.

Conversation

@CityVibes
Copy link
Contributor

Implemented calls to 2fa endpoints + wrapper method to authenticate by passing in mfa & otp.

@CityVibes CityVibes self-assigned this Aug 6, 2018
@CityVibes CityVibes requested a review from jensck August 6, 2018 13:11
@RaimundasSakalauskas RaimundasSakalauskas self-requested a review August 6, 2018 16:26
Copy link

@RaimundasSakalauskas RaimundasSakalauskas left a comment

Choose a reason for hiding this comment

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

Seems great. I might add "getMFAToken" to iOS too as this seems like a nice helper method.

Copy link
Contributor

@jensck jensck left a comment

Choose a reason for hiding this comment

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

If iOS has a getMFAToken(), either we should have it, too, or we should eliminate it from both.

I lean toward the latter. Do we really want this as public API? How would it be used for anything but the login code that we're already providing?

*
* @return server-provided multi-factor auth token or null
*/
public String getMfaToken() {
Copy link
Contributor

Choose a reason for hiding this comment

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

We're already using GSON everywhere else. Why the inconsistency?

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding a specialized auth method onto a generic API exception doesn't feel great to me. Could this specialized logic be handled elsewhere (somewhere that isn't exposed as public API surface)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note 'loadServerErrorMsg' method, we infact do not use gson here, so this is consistent with the rest of the class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe it has value as public API, we could however handle it elsewhere or have child exception, something like 'ParticleLoginException'.

@CityVibes
Copy link
Contributor Author

Just copying what I said on slack regarding mfa getter "I would say - yes, if we have public API for login why wouldn't we have public mfa token getter it's part of login flow after all. Shouldn't user be able to implement same behavior as our own tinker app?"

@CityVibes
Copy link
Contributor Author

Moved MFA getter to new ParticleLoginException (inherits from ParticleCloudException), this way we won't expose getter with exceptions unrelated to login.

@CityVibes CityVibes merged commit cdb639c into master Aug 7, 2018
@CityVibes CityVibes deleted the feature/2fa branch August 7, 2018 16:09
@jensck
Copy link
Contributor

jensck commented Aug 7, 2018

+1 for the specialized ParticleLoginException

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants