{
  "iface": "futoin.auth.service",
  "version": "0.4",
  "ftn3rev": "1.9",
  "imports": [
    "futoin.ping:1.0",
    "futoin.auth.types:0.4"
  ],
  "types": {
    "TemplateName": {
      "type": "GenericIdentifier",
      "maxlen": 32
    },
    "SessionStartToken": {
      "type": "Base64",
      "minlen": 22,
      "maxlen": 171
    },
    "SessionToken": {
      "type": "Base64",
      "minlen": 22,
      "maxlen": 171
    },
    "AuthQueryID": "UUIDB64",
    "AuthQueryNonce": {
      "type": "Base64",
      "maxlen": 22
    },
    "AuthQueryRequest": {
      "type": "map",
      "fields": {
        "id": "AuthQueryID",
        "ts": "Timestamp",
        "nonce": "AuthQueryNonce",
        "msid": "MasterSecretID"
      }
    },
    "AuthQueryResponse": {
      "type": "map",
      "fields": {
        "token": "SessionStartToken",
        "ts": "Timestamp",
        "nonce": "AuthQueryNonce",
        "msid": "MasterSecretID"
      }
    }
  },
  "funcs": {
    "declareAccessControl": {
      "params": {
        "access_groups": "AccessGroupList"
      },
      "result": "boolean"
    },
    "authQueryTemplate": {
      "params": {
        "name": "TemplateName",
        "acds": "ServiceAccessGroupList",
        "result_url": "RedirectURL"
      },
      "result": {
        "id": "AuthQueryID",
        "auth_url": "RedirectURL"
      },
      "throws": [
        "SecurityError"
      ]
    },
    "startSession": {
      "params": {
        "start_token": "SessionStartToken",
        "client": "ClientFingerprints"
      },
      "result": {
        "token": "SessionToken",
        "info": "AuthInfo"
      },
      "throws": [
        "InvalidStartToken",
        "PleaseReauth"
      ]
    },
    "resumeSession": {
      "params": {
        "start_token": "SessionToken",
        "client": "ClientFingerprints"
      },
      "result": "boolean",
      "throws": [
        "UnknownSession",
        "PleaseReauth"
      ]
    },
    "closeSession": {
      "params": {
        "start_token": "SessionToken"
      },
      "result": "boolean"
    }
  },
  "requires": [
    "SecureChannel",
    "MessageSignature"
  ]
}