Skip to content

Instantly share code, notes, and snippets.

@srinivasanagandla-okta
Created April 24, 2014 05:51
Show Gist options
  • Save srinivasanagandla-okta/151376d3e5c8a69ff48c to your computer and use it in GitHub Desktop.
Save srinivasanagandla-okta/151376d3e5c8a69ff48c to your computer and use it in GitHub Desktop.
Activate & Verify (No enrollment)

Activate, Verify Flow

Admin provisions the User Factor

[TBD]

Start Activation

Request

POST /api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO/lifecycle/activate HTTP/1.1
Host: your-subdomain.okta.com
Authorization: SSWS yourtoken
Accept: application/json
{
    "stateToken" : "NzYxMDAxIiwKICJhdWQiOiAiczZCaGRSa3F0"
}

Response

HTTP/1.1 202 ACCEPTED
Content-Type: application/json
{
    "status" : "PENDING_VERIFICATION",
    "expiresAt" : "2014-03-17T17:44:19.000Z",
    "nextAction" : "verify",
    "stateToken" : "NzYxMDAxIiwKICJhdWQiOiAiczZCaGRSa3F0",
    "_embedded" : {
         "verify" : {
              "requiresVerification" : "true",
              "noOfVerificationCodes" : "1"
          }
     },
    "_links": {
        "factor": {
            "href": "http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO",
            "hints": { 
                "allow": ["GET"]
            },
        "verify": {
            "href": "http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO/lifecycle/verify",
            "hints": { 
                "allow": ["POST"]
            },
       "resend": {
            "href": "http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO/lifecycle/activate?resend=true",
            "hints": { 
                "allow": ["POST"]
            }
        }
}

Verify Factor

Request

POST /api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO/lifecycle/verify HTTP/1.1
Host: your-subdomain.okta.com
Authorization: SSWS yourtoken
Accept: application/json
Content-Type: application/json
{
    "stateToken" : "NzYxMDAxIiwKICJhdWQiOiAiczZCaGRSa3F0",
    "activationCode" : 738402
}

Response

HTTP/1.1 202 ACCEPTED
Content-Type: application/json
{
    "id": "00ud4tVDDXYVKPXKVLCO",
    "stateToken" : "NzYxMDAxIiwKICJhdWQiOiAiczZCaGRSa3F0",
    "verificationStatus": "SUCCESS",
    "status": "ACTIVE",
    "_links": {
        "factor": {
            "href": "http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO",
            "hints": { 
                "allow": ["GET"]
                }
           }
      }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment