Skip to content

Instantly share code, notes, and snippets.

@srinivasanagandla-okta
Last active April 2, 2019 20:59
Show Gist options
  • Save srinivasanagandla-okta/66edede6f7c51f7973fe to your computer and use it in GitHub Desktop.
Save srinivasanagandla-okta/66edede6f7c51f7973fe to your computer and use it in GitHub Desktop.
MFA-User-API

MFA User API

MFA User API provides a way to enroll, activating and resetting/revoking users for any available 2nd Factor.

Enroll for a Factor

POST /api/v1/users/{userId}/factors

Request Parameters
Parameter Description Param Type DataType Required Default
activate Indicates whether to kick-off activation process URL Boolean Optional false
userId User Id URL String Yes
factorType MFA Type Body [FactorType] (https://gist.github.com/srinivasanagandla-okta/d2fa700981b236a67321#factor-types) TRUE None
deviceType Device Type Body [DeviceType] (https://gist.github.com/srinivasanagandla-okta/d2fa700981b236a67321#device-types) TRUE None
provider Provider of the Factor Body [Provider] (https://gist.github.com/srinivasanagandla-okta/d2fa700981b236a67321#factor-providers) TRUE orn:okta:factor:provider:okta
profile Profile Information Body [Profile Information] (https://gist.github.com/srinivasanagandla-okta/d2fa700981b236a67321) TRUE None
Response Parameters
Parameter Description Param Type DataType Required Default
id Id of the User Factor Body String Yes
factorType MFA Type Body [FactorType] (https://gist.github.com/srinivasanagandla-okta/d2fa700981b236a67321#factor-types) TRUE None
status Status of the Factor Body Factor Status Yes ACTIVATION_PENDING
created Creation Timestamp Body Timestamp Yes
lastUpdated Last Update Timestamp Body Timestamp Yes
activated Activation Timestamp Body Timestamp Yes
_links Resources related to the User Factor Body JSON HAL Optional
_embedded Objects related to the Enrollment Body JSON HAL Optional

Start Activation

POST /api/v1/users/{userId}/factors/{factorId}/lifecycle/activate

Request Parameters
Parameter Description Param Type DataType Required Default
userId User Id of the User URL String Yes
factorId Id of the User Factor URL String Yes
Response
Success Case:

[Activation Response] (https://gist.github.com/srinivasanagandla-okta/66edede6f7c51f7973fe#response-parameters)

Notes:

  • _links will be populated with "self", "activate","user", "provider", "barcode", "appStore" links
  • _embedded will be populated with "activation" object
Failure Case:

[Activation Failure]

Verify Factor

POST /api/v1/users/{userId}/factors/{factorId}/lifecycle/activate

Request Parameters
Parameter Description Param Type DataType Required Default
userId Id of the User URL String Yes
factorId Id of the User Factor URL String Yes
activationCode1 Activation Code from the User Body String Yes
activationCode2 Activation Code2 from the User Body String Optional
Response
Success Case:

[Activation Response] (https://gist.github.com/srinivasanagandla-okta/66edede6f7c51f7973fe#response-parameters)

Notes:

  • _links will be populated with "self", "activate","user", "provider", "barcode", "appStore" links
  • _embedded will be populated with "activation" object
Failure Case:

[Activation Failure]

Get/Poll Factor Information

GET /api/v1/users/{userId}/factors/{factorId}

Request Parameters
Parameter Description Param Type DataType Required Default
userId Id of the User URL String Yes
factorId Id of the User Factor URL String Yes
Response Parameters

Same as this ==> [Factor Information] (https://gist.github.com/srinivasanagandla-okta/66edede6f7c51f7973fe#response-parameters)

Reset Factor

POST /api/v1/users/{userId}/factors/{factorId}/lifecycle/deactivate

Request Parameters
Parameter Description Param Type DataType Required Default
userId User Id of the User URL String Yes
factorId Id of the User Factor URL String Yes
Response Parameters
Parameter Description Param Type DataType Required Default
id Id of the User Factor Body String Yes
status Status of the Factor Body Factor Status Yes DELETED

Sync Factor

POST /api/v1/users/{userId}/factors/{factorId}/sync

Request Parameters
Parameter Description Param Type DataType Required Default
factorId Id of the User Factor Body String Yes
passCode1 PassCode1 to sync Body String Yes
passCode2 PassCode2 to sync Body String Yes
passCode3 PassCode3 to sync Body String Yes
Response Parameters
Parameter Description Param Type DataType Required Default
factorId Id of the User Factor Body String Yes
syncStatus Status of the Sync Body String Yes SYNC_PENDING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment