kumsa29

Adv Authentication : Sample Request for AA Rest Call

Blog Post created by kumsa29 Employee on Aug 22, 2018

Sample Request for AA Rest Call

 

Fetch Credential:

 URL : http://localhost:18080/aa-restapi/ca/advancedauth/v1/org/defaultorg/user/TESTUSER01/credential?(type eq "otp")

Method : GET

Request Body : NONE

Response:

[

    {

        "org": "DEFAULTORG",

        "id": "TESTUSER01",

        "txnId": "20587",

        "responseCode": 0,

        "responseMessage": "The operation was successful.",

        "cred": {

            "credParams": {

                "remainingUsageCount": "0"

            },

            "credType": "OTP",

            "issuanceProfile": "p1",

            "remainingUsageCount": 0,

            "passPhrase": ""

        },

        "validityEndTime": "2018-09-01T21:49:30.00Z",

        "validityStartTime": "2018-08-22T21:49:30.00Z",

        "credStatus": "UNKNOWN",

        "numOfFailedAttempts": 0,

        "lastSuccessAttempt": "2018-08-22T21:49:58.00Z"

    }

]

 

Create Credential:

 

URL: http://localhost:18080/aa-restapi/ca/advancedauth/v1/org/defaultorg/user/TESTUSER01/credential

Method: Post

Headers : Content-Type = application/json

Request Body:

{

  "creds": [

    { "credType": "OTP",

     "issuanceProfile": "p1"

    }

  ]

}

 

Response Body

{

    "org": "DEFAULTORG",

    "id": "TESTUSER01",

    "txnId": "20588",

    "responseCode": 0,

    "responseMessage": "The operation was successful.",

    "cred": {

        "credParams": {

            "remainingUsageCount": "1"

        },

        "credType": "OTP",

        "issuanceProfile": "p1",

        "remainingUsageCount": 0,

        "passPhrase": "480846"

    },

    "validityEndTime": "2018-09-01T22:38:42.00Z",

    "validityStartTime": "2018-08-22T22:38:42.00Z",

    "credStatus": "ACTIVE",

    "numOfFailedAttempts": 0

}

 

Authenticate Credential :

 

URL: http://localhost:18080/aa-restapi/ca/advancedauth/v1/org/DEFAULTORG/user/TESTUSER01/credential/auth

Method: Post

Headers : Content-Type = application/json

Request Body:

{

  "authTokenType": "NATIVE",

  "creds": [

    {

      "credType": "otp",

      "authPolicy": "p1",

      "passPhrase": "009912"

    }

  ]

}

 

Response Body:

{

    "authToken": "QMXeNwbnL0IiRzWPY5dn87nzPJZnWiIwhKjbgLA8bJ-CIhIgbdAZV5ZET4lzzF__UOIBpr1aVtY",

    "txnId": "20591",

    "responseCode": "0",

    "responseMessage": "The operation was successful.",

    "validityEndTime": "2018-09-01T22:40:57.00Z",

    "numOfFailedAttempts": 0,

    "creationTime": "2018-08-22T22:40:57.00Z",

    "orgId": "DEFAULTORG",

    "userId": "TESTUSER01"

}

Outcomes