okta/okta-auth-swift

Access links in response

nbarbettini opened this issue · 1 comments

The _links property in some API responses is a collection of links (URLs and methods) that can be used to continue moving the user through the state machine.

The SDK must allow the developer to retrieve the available links (if any).

For example, the Authentication API may return this response if a user is locked out. The next link represents the next action the user should take (unlocking the account):

{
  "status": "LOCKED_OUT",
  "_links": {
    "next": {
      "name": "unlock",
      "href": "https://atko-corporation-application.oktapreview.com/api/v1/authn/recovery/unlock",
      "hints": {
        "allow": [
          "POST"
        ]
      }
    }
  }
}

Done. Use func perform(link: LinksResponse.Link) in AuthenticationClient