{"info":{"_postman_id":"ab805e61-971e-4959-91c6-2e7a44ec9886","name":"Authentication Service Back","description":"## Introduction\nThis service handles the authentication of user credentials when\nattempting to access the Riskalyze network. This includes both advisors\nlogging in to the product as well as third-party APIs integrating with our system.\n\n## Error Codes\n| Code       | Description\n|:----------:| -------------------\n| **4xxxxx** | **Client-Side Errors**\n| 400000     | Generic client-side error\n| 400100     | Resource Not Found\n| 400200     | Validation Error\n| 400300     | Authentication Failed\n| 400400     | Resource Conflict\n| **5xxxxx** | **Server-Side Errors**\n| 500000     | Unexpected server-side error\n\n##Authorization\n\nCertain endpoints require an Authortization header \n\n```Authorization:Key {{apiKey}}```\n\nIn order to obtain a new api key please PR one into the repository and request an data change in production.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json"},"item":[{"name":"v1","item":[{"name":"identities","item":[{"name":"Create Identity","event":[{"listen":"test","script":{"id":"b1bc5226-4ef0-4bf1-9525-f67a514ee24d","type":"text/javascript","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.have.property(\"id\");","    pm.expect(jsonData).to.have.property(\"authenticationMethods\");","    pm.expect(jsonData.authenticationMethods).to.be.an('array').that.is.empty;","});","","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","","pm.environment.set(\"identityId\", jsonData.id);",""]}}],"id":"cba4a82b-7d5d-4bad-8f3a-382a247e64a7","request":{"method":"POST","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":""},"url":"{{protocol}}://{{host}}/api/v1/identities","description":"Creates a new identity that can authenticate."},"response":[],"_postman_id":"cba4a82b-7d5d-4bad-8f3a-382a247e64a7"},{"name":"Suspend Idenity","event":[{"listen":"test","script":{"id":"b1bc5226-4ef0-4bf1-9525-f67a514ee24d","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.have.property(\"id\");","    pm.expect(jsonData).to.have.property(\"authenticationMethods\");","    pm.expect(jsonData.authenticationMethods).to.be.an('array').that.is.empty;","});","","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","","pm.environment.set(\"identityId\", jsonData.id);",""],"type":"text/javascript"}}],"id":"a8037829-926c-4386-93b8-3ab3125ccc60","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":"{\n\t\"suspended\": true\n}"},"url":"{{protocol}}://{{host}}/api/v1/identities/{{identityId}}","description":"Suspends a existing identity preventing authentication."},"response":[],"_postman_id":"a8037829-926c-4386-93b8-3ab3125ccc60"},{"name":"Unsuspend Idenity","event":[{"listen":"test","script":{"id":"b1bc5226-4ef0-4bf1-9525-f67a514ee24d","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.have.property(\"id\");","    pm.expect(jsonData).to.have.property(\"authenticationMethods\");","    pm.expect(jsonData.authenticationMethods).to.be.an('array').that.is.empty;","});","","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","","pm.environment.set(\"identityId\", jsonData.id);",""],"type":"text/javascript"}}],"id":"14aefcc3-cdd6-4b6f-b039-cd0404d79e89","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":"{\n\t\"suspended\": false\n}"},"url":"{{protocol}}://{{host}}/api/v1/identities/{{identityId}}","description":"Removes suspenion of existing identity allowing authentication."},"response":[],"_postman_id":"14aefcc3-cdd6-4b6f-b039-cd0404d79e89"},{"name":"Create Identity w/ Authentication Method(s)","event":[{"listen":"test","script":{"id":"12708eab-0428-4e02-8078-53a989057249","type":"text/javascript","exec":["let jsonData = pm.response.json();","let tokenMethod = findMethodByType(jsonData.authenticationMethods, \"token\");","let keyMethod = findMethodByType(jsonData.authenticationMethods, \"key\");","let passwordMethod = findMethodByType(jsonData.authenticationMethods, \"password\");","","pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.have.property(\"id\");","    pm.expect(jsonData).to.have.property(\"authenticationMethods\");","    pm.expect(jsonData.authenticationMethods).to.be.an('array')","    "," ","    //token tests","    pm.expect(tokenMethod).to.exist;","    pm.expect(tokenMethod).to.have.property(\"method\", \"token\");","    pm.expect(tokenMethod).to.have.property(\"isValid\", true);","    pm.expect(tokenMethod).to.have.property(\"token\");","    ","    //key","    pm.expect(keyMethod).to.exist;","    pm.expect(keyMethod).to.have.property(\"method\", \"key\");","    pm.expect(keyMethod).to.have.property(\"name\", \"My Key\");","    pm.expect(keyMethod).to.have.property(\"isEnabled\", true);","    pm.expect(keyMethod).to.have.property(\"key\");","    ","    //password tests","    pm.expect(passwordMethod).to.exist;","    pm.expect(passwordMethod).to.have.property(\"method\", \"password\");","    pm.expect(passwordMethod).to.have.property(\"email\", pm.environment.get(\"identityEmail\"));","});","","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.environment.set(\"identityId\", jsonData.id);","pm.environment.set(\"identityToken\", tokenMethod.token);","pm.environment.set(\"identityKey\", keyMethod.key);","","function findMethodByType(authMethods, type){","    return authMethods.find((am) => am.method === type);","}",""]}},{"listen":"prerequest","script":{"id":"bf158f69-fd78-4495-b53f-29f189c00cd3","type":"text/javascript","exec":["pm.environment.set(\"identityEmail\", Math.random().toString(36).substring(7) + \"@domain.com\");"]}}],"id":"9c9cd7c4-4b1e-416f-830c-27f2baef3184","request":{"method":"POST","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":"{\n   \"authenticationMethods\": [\n    {\n      \"method\":\"token\",\n      \"length\": 64,\n      \"ttl\": 3600\n    },\n    {\n      \"method\":\"key\",\n      \"name\": \"My Key\"\n      \n    },\n    {\n      \"applicationId\": 1,\n      \"method\":\"password\",\n      \"email\": \"{{identityEmail}}\",\n      \"password\": \"!Password1\"\n      \n    }\n  ]\n}"},"url":"{{protocol}}://{{host}}/api/v1/identities","description":"Creates a new identity that can authenticate with the attached authentication methods."},"response":[],"_postman_id":"9c9cd7c4-4b1e-416f-830c-27f2baef3184"},{"name":"Create Token Authentication Method","event":[{"listen":"prerequest","script":{"id":"aeea46c5-f4f0-4a00-9210-b38a4a23acff","type":"text/javascript","exec":["if(!pm.environment.get(\"identityId\")){","    throw new Error(\"identityId must be set for this request, Please create an identity and try again.\");","}","",""]}},{"listen":"test","script":{"id":"6d8a83f9-ff9e-4bd1-875b-a6bd3754b495","type":"text/javascript","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.environment.set(\"identityToken\", jsonData[0].token);","",""]}}],"id":"94f432ba-b9a4-4320-b1e0-1f2d80861312","request":{"method":"POST","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":"{  \n   \"authenticationMethods\":[  \n      {  \n         \"method\":\"token\"\n      }\n   ]\n}"},"url":"{{protocol}}://{{host}}/api/v1/identities/{{identityId}}/authentication-methods","description":"Creates a One Time Password authentication method for an existing identity."},"response":[],"_postman_id":"94f432ba-b9a4-4320-b1e0-1f2d80861312"},{"name":"Create Token Authentication Method w/ TTL","event":[{"listen":"prerequest","script":{"id":"e1684224-5e23-4656-be5f-b706fd05f0a7","type":"text/javascript","exec":["if(!pm.environment.get(\"identityId\")){","    throw new Error(\"identityId must be set for this request, Please create an identity and try again.\");","}",""]}},{"listen":"test","script":{"id":"b807777a-5e1d-407a-ba30-cb369b5fbfc0","type":"text/javascript","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.environment.set(\"identityToken\", jsonData[0].token);","",""]}}],"id":"9361830e-710d-43e4-8dcd-4d5353c3055a","request":{"method":"POST","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":"{  \n   \"authenticationMethods\":[  \n      {  \n         \"method\":\"token\",\n         \"ttl\":3600\n      }\n   ]\n}"},"url":"{{protocol}}://{{host}}/api/v1/identities/{{identityId}}/authentication-methods","description":"Creates a One Time Password(with expiration) authentication method for an existing identity."},"response":[],"_postman_id":"9361830e-710d-43e4-8dcd-4d5353c3055a"},{"name":"Create Password Authentication Method","event":[{"listen":"prerequest","script":{"id":"6be3d239-6c1f-4b1a-ba16-63d931886221","type":"text/javascript","exec":["if(!pm.environment.get(\"identityId\")){","    throw new Error(\"identityId must be set for this request, Please create an identity and try again.\");","}","","","pm.environment.set(\"identityEmail\", Math.random().toString(36).substring(7) + \"@domain.com\");"]}},{"listen":"test","script":{"id":"c9a74ecc-123b-48ce-b0ae-63bb40662cd2","type":"text/javascript","exec":["pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","pm.test(\"Response time is less than 1000ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(1000);","});"]}}],"id":"65e962b6-38ba-498c-b4fb-eb43b4e29bbb","request":{"method":"POST","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":"{  \n   \"authenticationMethods\":[  \n      {  \n    \t \"applicationId\": 1,\n         \"method\":\"password\",\n         \"email\":\"{{identityEmail}}\",\n         \"password\":\"!Password1\"\n      }\n   ]\n}"},"url":"{{protocol}}://{{host}}/api/v1/identities/{{identityId}}/authentication-methods","description":"Creates a Password Authentication method for an existing identity."},"response":[],"_postman_id":"65e962b6-38ba-498c-b4fb-eb43b4e29bbb"},{"name":"Create Key Authentication Method","event":[{"listen":"prerequest","script":{"id":"6be3d239-6c1f-4b1a-ba16-63d931886221","type":"text/javascript","exec":["if(!pm.environment.get(\"identityId\")){","    throw new Error(\"identityId must be set for this request, Please create an identity and try again.\");","}","","","pm.environment.set(\"identityEmail\", Math.random().toString(36).substring(7) + \"@domain.com\");"]}},{"listen":"test","script":{"id":"6417f4be-cf12-403c-9f58-2c1c0cb7c5b0","type":"text/javascript","exec":["var jsonData = pm.response.json();","let tokenMethod = findMethodByType(jsonData, \"token\");","let keyMethod = findMethodByType(jsonData, \"key\");","let passwordMethod = findMethodByType(jsonData, \"password\");","","pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","","pm.environment.set(\"identityKey\", keyMethod.key);","",""]}}],"id":"ac50d577-8295-4f04-a91a-857f28256c5a","request":{"method":"POST","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":"{  \n   \"authenticationMethods\":[  \n      {  \n         \"method\":\"key\",\n         \"name\":\"My Key\"\n      }\n   ]\n}"},"url":"{{protocol}}://{{host}}/api/v1/identities/{{identityId}}/authentication-methods","description":"Creates an Api Key method for an existing identity."},"response":[],"_postman_id":"ac50d577-8295-4f04-a91a-857f28256c5a"},{"name":"Get Identity","id":"d8b87050-c65e-445c-b775-bda28cdb86ed","request":{"method":"GET","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"url":"{{protocol}}://{{host}}/api/v1/identities/{{identityId}}","description":"Get the identity for a given id."},"response":[],"_postman_id":"d8b87050-c65e-445c-b775-bda28cdb86ed"},{"name":"Get Sessions for Identity","event":[{"listen":"test","script":{"id":"5522f5f7-f6b1-4e7b-b6d1-f517a0031021","type":"text/javascript","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.be.an('object')","    pm.expect(jsonData).to.have.property(\"items\");","    pm.expect(jsonData.items).to.be.an(\"array\");","    pm.expect(jsonData).to.have.property(\"pageNumber\");","    pm.expect(jsonData).to.have.property(\"pageSize\");","    ","    ","    if(jsonData.items){","        jsonData.items.forEach((item) => {","            pm.expect(item).to.have.property(\"id\"); ","            pm.expect(item).to.have.property(\"status\");","            pm.expect(item).to.have.property(\"identityId\", pm.environment.get(\"identityId\"));","        });","    }","});","","",""]}}],"id":"87fe7ce2-9151-43ef-93e2-e6239b27b139","request":{"method":"GET","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":""},"url":"{{protocol}}://{{host}}/api/v1/identities/{{identityId}}/sessions","description":"Get a list of all sessions for the given identity id."},"response":[],"_postman_id":"87fe7ce2-9151-43ef-93e2-e6239b27b139"},{"name":"Get Sessions for Identity w/ Paging","event":[{"listen":"test","script":{"id":"b65bda04-8c80-4ba4-9133-fe83896131db","type":"text/javascript","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.be.an('object')","    pm.expect(jsonData).to.have.property(\"items\");","    pm.expect(jsonData.items).to.be.an(\"array\");","    pm.expect(jsonData.items.length <= +pm.environment.get(\"pageSize\")).to.be.true;","    pm.expect(jsonData).to.have.property(\"pageNumber\", +pm.environment.get(\"pageNumber\"));","    pm.expect(jsonData).to.have.property(\"pageSize\",  +pm.environment.get(\"pageSize\"));","    ","    ","    if(jsonData.items){","        jsonData.items.forEach((item) => {","            pm.expect(item).to.have.property(\"id\"); ","            pm.expect(item).to.have.property(\"status\");","            pm.expect(item).to.have.property(\"identityId\", pm.environment.get(\"identityId\"));","        });","    }","});","","",""]}}],"id":"e5d6cd26-882d-409e-8cf5-f1a36085dd02","request":{"method":"GET","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":""},"url":{"raw":"{{protocol}}://{{host}}/api/v1/identities/{{identityId}}/sessions?pageNumber={{pageNumber}}&pageSize={{pageSize}}&includeCount={{includeCount}}","protocol":"{{protocol}}","host":["{{host}}"],"path":["api","v1","identities","{{identityId}}","sessions"],"query":[{"key":"pageNumber","value":"{{pageNumber}}"},{"key":"pageSize","value":"{{pageSize}}"},{"key":"includeCount","value":"{{includeCount}}"}]},"description":"Get a paginated list of all sessions for the given identity id."},"response":[],"_postman_id":"e5d6cd26-882d-409e-8cf5-f1a36085dd02"},{"name":"Get Active Sessions for Identity","event":[{"listen":"test","script":{"id":"7e771d94-20d7-412b-929f-87d4c8d7d399","type":"text/javascript","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.be.an('object')","    pm.expect(jsonData).to.have.property(\"items\");","    pm.expect(jsonData.items).to.be.an(\"array\");","    ","    if(jsonData.items){","        jsonData.items.forEach((item) => {","            pm.expect(item).to.have.property(\"id\"); ","            pm.expect(item).to.have.property(\"status\", \"active\");","            pm.expect(item).to.have.property(\"identityId\", pm.environment.get(\"identityId\"));","        });","    }","});","","",""]}}],"id":"26c7d663-bd30-4f18-958a-aab4dc7efbb4","request":{"method":"GET","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":""},"url":{"raw":"{{protocol}}://{{host}}/api/v1/identities/{{identityId}}/sessions?status=active","protocol":"{{protocol}}","host":["{{host}}"],"path":["api","v1","identities","{{identityId}}","sessions"],"query":[{"key":"status","value":"active"}]},"description":"Get a list of all active sessions for an identity."},"response":[],"_postman_id":"26c7d663-bd30-4f18-958a-aab4dc7efbb4"},{"name":"Get Expired Sessions for Identity","event":[{"listen":"test","script":{"id":"84543133-73ae-4072-82d9-87e5082d612e","type":"text/javascript","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.be.an('object')","    pm.expect(jsonData).to.have.property(\"items\");","    pm.expect(jsonData.items).to.be.an(\"array\");","    ","    if(jsonData.items){","        jsonData.items.forEach((item) => {","            pm.expect(item).to.have.property(\"id\"); ","            pm.expect(item).to.have.property(\"status\", \"expired\");","            pm.expect(item).to.have.property(\"identityId\", pm.environment.get(\"identityId\"));","        });","    }","});","","",""]}}],"id":"58afedfd-0d0a-4473-bfc3-fb322c45ced4","request":{"method":"GET","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":""},"url":{"raw":"{{protocol}}://{{host}}/api/v1/identities/{{identityId}}/sessions?status=expired","protocol":"{{protocol}}","host":["{{host}}"],"path":["api","v1","identities","{{identityId}}","sessions"],"query":[{"key":"status","value":"expired"}]},"description":"Get a list of all expired sessions for an identity."},"response":[],"_postman_id":"58afedfd-0d0a-4473-bfc3-fb322c45ced4"},{"name":"Get Terminated Sessions for Identity","event":[{"listen":"test","script":{"id":"bc75cd69-4bb5-44dc-bd65-de1f95abb887","type":"text/javascript","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.be.an('object')","    pm.expect(jsonData).to.have.property(\"items\");","    pm.expect(jsonData.items).to.be.an(\"array\");","    ","    if(jsonData.items){","        jsonData.items.forEach((item) => {","            pm.expect(item).to.have.property(\"id\"); ","            pm.expect(item).to.have.property(\"status\", \"terminated\");","            pm.expect(item).to.have.property(\"identityId\", pm.environment.get(\"identityId\"));","        });","    }","});","","",""]}}],"id":"b7a752ed-7a29-44ad-9be8-e6d2e45ddf6c","request":{"method":"GET","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":""},"url":{"raw":"{{protocol}}://{{host}}/api/v1/identities/{{identityId}}/sessions?status=terminated","protocol":"{{protocol}}","host":["{{host}}"],"path":["api","v1","identities","{{identityId}}","sessions"],"query":[{"key":"status","value":"terminated"}]},"description":"Get a list of all terminated sessions for an identity."},"response":[],"_postman_id":"b7a752ed-7a29-44ad-9be8-e6d2e45ddf6c"}],"id":"2c8fba33-9438-40d1-b3b5-28b2e9318d35","event":[{"listen":"prerequest","script":{"id":"4ddfc30b-9d2b-4daa-b120-ab447c59e916","type":"text/javascript","exec":["function findMethodByType(authMethods, type){","    return authMethods.find((am) => am.method === type);","}"]}},{"listen":"test","script":{"id":"f9fea0a0-e39d-43de-8b9f-3e598c454c2c","type":"text/javascript","exec":[""]}}],"_postman_id":"2c8fba33-9438-40d1-b3b5-28b2e9318d35"},{"name":"password-management","item":[{"name":"Send Password Reset","event":[{"listen":"test","script":{"id":"63ec60fa-f83b-4b2a-9211-9029127612a7","type":"text/javascript","exec":["","pm.test(\"Status code is 204\", function () {","    pm.response.to.have.status(204);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","","",""]}}],"id":"d6586086-794b-4040-b96e-1d6ec31d9913","request":{"method":"POST","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":"{\n\t\"applicationId\": 1,\n\t\"email\": \"{{identityEmail}}\"\n}"},"url":"{{protocol}}://{{host}}/api/v1/password-resets/","description":"Sends a password reset token to the provided email address"},"response":[],"_postman_id":"d6586086-794b-4040-b96e-1d6ec31d9913"},{"name":"Get Password Reset","event":[{"listen":"test","script":{"id":"63ec60fa-f83b-4b2a-9211-9029127612a7","type":"text/javascript","exec":["","pm.test(\"Status code is 204\", function () {","    pm.response.to.have.status(204);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","","",""]}}],"id":"43b6dcac-8c70-4350-a5e2-79e79aeccece","request":{"method":"GET","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":"{\n  \"email\": \"{{identityEmail}}\"\n}"},"url":"{{protocol}}://{{host}}/api/v1/password-resets/{{resetToken}}"},"response":[],"_postman_id":"43b6dcac-8c70-4350-a5e2-79e79aeccece"},{"name":"Password Reset","id":"6cf2df1b-3107-41a7-b1c6-a5a0e524d31e","request":{"method":"POST","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":"{\n\t\"password\": \"!Password3\"\n}"},"url":"{{protocol}}://{{host}}/api/v1/password-resets/{{resetToken}}","description":"Resets the password associated with the provided reset token"},"response":[],"_postman_id":"6cf2df1b-3107-41a7-b1c6-a5a0e524d31e"},{"name":"Password Reset w/ No Reuse","id":"cbb7514e-e941-4228-b5ef-d4328198951d","request":{"method":"POST","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":"{\n    \"password\": \"!Password3\",\n    \"restrictPasswordReuse\": true\n}"},"url":"{{protocol}}://{{host}}/api/v1/password-resets/{{resetToken}}","description":"Resets the password associated with the provided reset token"},"response":[],"_postman_id":"cbb7514e-e941-4228-b5ef-d4328198951d"},{"name":"List Active Sessions","event":[{"listen":"test","script":{"id":"8b054820-3dbe-438c-a7d3-af9efd3a6c47","type":"text/javascript","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.be.an('object')","    pm.expect(jsonData).to.have.property(\"items\");","    pm.expect(jsonData.items).to.be.an(\"array\");","    pm.expect(jsonData.items.length <= +pm.environment.get(\"pageSize\")).to.be.true;","    pm.expect(jsonData).to.have.property(\"pageNumber\");","    pm.expect(jsonData).to.have.property(\"pageSize\");","    ","    ","    if(jsonData.items){","        jsonData.items.forEach((item) => {","            pm.expect(item).to.have.property(\"id\"); ","            pm.expect(item).to.have.property(\"status\", \"active\");","            pm.expect(item).to.have.property(\"identityId\");","        });","    }","});","","",""]}}],"id":"d4f622b8-ab86-447e-b946-3433163e0ca0","request":{"method":"GET","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":""},"url":{"raw":"{{protocol}}://{{host}}/api/v1/sessions?status=active","protocol":"{{protocol}}","host":["{{host}}"],"path":["api","v1","sessions"],"query":[{"key":"status","value":"active"}]}},"response":[],"_postman_id":"d4f622b8-ab86-447e-b946-3433163e0ca0"}],"id":"0ccaa0ad-02d4-47a2-baef-421c3052e7aa","_postman_id":"0ccaa0ad-02d4-47a2-baef-421c3052e7aa"},{"name":"rpc","item":[{"name":"Change Email","id":"02553995-86f9-4e1e-90a1-03efbf493ea2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Key 00ce040ac297a542ed6de3ccd57c6e9494071e03a49f7534701a64fd4497a7b9"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"applicationId\": 1,\n\t\"oldEmail\": \"rgilmer@whitcomb.com\",\n\t\"newEmail\": \"rgilmer+old@whitcomb.com\"\n}"},"url":"{{protocol}}://{{host}}/rpc/v1/change-email"},"response":[],"_postman_id":"02553995-86f9-4e1e-90a1-03efbf493ea2"},{"name":"Decode Ids","id":"b97ce998-1a8f-4e1a-b2ef-fe50cad139a1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Key 00ce040ac297a542ed6de3ccd57c6e9494071e03a49f7534701a64fd4497a7b9"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"hashIds\": [\"24pgvd56\", \"gqk7xym\"],\n\t\"entityType\": \"Identity\"\n}"},"url":"{{protocol}}://{{host}}/rpc/v1/decode-ids"},"response":[],"_postman_id":"b97ce998-1a8f-4e1a-b2ef-fe50cad139a1"}],"id":"eb3f01d4-9e7d-4681-813e-4c832f8e87f7","_postman_id":"eb3f01d4-9e7d-4681-813e-4c832f8e87f7"},{"name":"authentication-methods","item":[{"name":"Reserve Email for Identity","event":[{"listen":"test","script":{"id":"b1bc5226-4ef0-4bf1-9525-f67a514ee24d","type":"text/javascript","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.have.property(\"id\");","    pm.expect(jsonData).to.have.property(\"authenticationMethods\");","    pm.expect(jsonData.authenticationMethods).to.be.an('array').that.is.empty;","});","","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","","pm.environment.set(\"identityId\", jsonData.id);",""]}}],"id":"f9982ca9-47df-46b2-a658-0d42200bd212","request":{"method":"POST","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Authorization","value":"Key {{apiKey}}"}],"body":{"mode":"raw","raw":"{\n\t\"authenticationMethods\": [\n\t\t{\n\t\t\t\"method\": \"password\",\n\t\t\t\"applicationId\": 996533,\n\t\t\t\"email\": \"mlim+friday@riskalyze.com\",\n\t\t\t\"reserveEmail\": true\n\t\t}\n\t]\n}"},"url":"{{protocol}}://{{host}}/api/v1/identities/zgyq56y/authentication-methods"},"response":[],"_postman_id":"f9982ca9-47df-46b2-a658-0d42200bd212"}],"id":"e3d606c5-2658-4da9-86fa-5f09d7bebe5b","_postman_id":"e3d606c5-2658-4da9-86fa-5f09d7bebe5b"},{"name":"two-factor","item":[{"name":"Create Authenticator Two Factor","event":[{"listen":"prerequest","script":{"id":"25997cfb-9666-4718-a84d-c3f0acce2653","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"41fe889c-4aaf-4cf5-8f52-79e748882a60","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.be.an('object')","    pm.expect(jsonData).to.have.property(\"secret\"); ","    pm.expect(jsonData).to.have.property(\"qrCode\");","    pm.expect(jsonData).to.have.property(\"challengeToken\");","});","","","pm.environment.set(\"challengeToken\", jsonData.challengeToken);"],"type":"text/javascript"}}],"id":"6b43e871-a3ac-41f9-ac90-909936544ebf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"}],"body":{"mode":"raw","raw":"{\n\t\"type\": \"AUTHENTICATOR\",\n\t\"label\": \"Duo\",\n\t\"sessionId\": \"{{sessionId}}\"\n}"},"url":"{{protocol}}://{{host}}/api/v1/two-factors"},"response":[],"_postman_id":"6b43e871-a3ac-41f9-ac90-909936544ebf"},{"name":"Create SMS Two Factor","event":[{"listen":"prerequest","script":{"id":"25997cfb-9666-4718-a84d-c3f0acce2653","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"41fe889c-4aaf-4cf5-8f52-79e748882a60","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.be.an('object')","    pm.expect(jsonData).to.have.property(\"secret\"); ","    pm.expect(jsonData).to.have.property(\"qrCode\");","    pm.expect(jsonData).to.have.property(\"challengeToken\");","});","","pm.environment.set(\"challengeToken\", jsonData.challengeToken);"],"type":"text/javascript"}}],"id":"ac425a4a-9efb-4872-893b-04d1f83db18e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"}],"body":{"mode":"raw","raw":"{\n\t\"type\": \"SMS\",\n\t\"label\": \"Duo\",\n\t\"sessionId\": \"{{sessionId}}\",\n\t\"mobileNumber\": \"19162130839\"\n}"},"url":"{{protocol}}://{{host}}/api/v1/two-factors"},"response":[],"_postman_id":"ac425a4a-9efb-4872-893b-04d1f83db18e"},{"name":"Create Email Two Factor","event":[{"listen":"prerequest","script":{"id":"25997cfb-9666-4718-a84d-c3f0acce2653","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"41fe889c-4aaf-4cf5-8f52-79e748882a60","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.be.an('object')","    pm.expect(jsonData).to.have.property(\"secret\"); ","    pm.expect(jsonData).to.have.property(\"qrCode\");","    pm.expect(jsonData).to.have.property(\"challengeToken\");","});","","pm.environment.set(\"challengeToken\", jsonData.challengeToken);"],"type":"text/javascript"}}],"id":"54f2dd27-1fab-4726-be54-cffe206c52cd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"}],"body":{"mode":"raw","raw":"{\n\t\"type\": \"EMAIL\",\n\t\"label\": \"Duo\",\n\t\"issuer\": \"RAP\",\n\t\"sessionId\": \"{{sessionId}}\"\n}"},"url":"{{protocol}}://{{host}}/api/v1/two-factors"},"response":[],"_postman_id":"54f2dd27-1fab-4726-be54-cffe206c52cd"},{"name":"Update Two Factor State","event":[{"listen":"prerequest","script":{"id":"25997cfb-9666-4718-a84d-c3f0acce2653","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"41fe889c-4aaf-4cf5-8f52-79e748882a60","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.be.an('object')","    pm.expect(jsonData).to.have.property(\"secret\"); ","    pm.expect(jsonData).to.have.property(\"qrCode\");","    pm.expect(jsonData).to.have.property(\"challengeToken\");","});"],"type":"text/javascript"}}],"id":"43b1d2ac-e69d-4069-9ede-e9ed4658a46f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"}],"body":{"mode":"raw","raw":"{\n\t\"isEnabled\": true,\n\t\"isDefault\": true\n}"},"url":"{{protocol}}://{{host}}/api/v1/two-factors/{{twoFactorId}}"},"response":[],"_postman_id":"43b1d2ac-e69d-4069-9ede-e9ed4658a46f"},{"name":"Finalize Two Factor Enrollment","event":[{"listen":"prerequest","script":{"id":"25997cfb-9666-4718-a84d-c3f0acce2653","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"41fe889c-4aaf-4cf5-8f52-79e748882a60","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.be.an('object')","    pm.expect(jsonData).to.have.property(\"secret\"); ","    pm.expect(jsonData).to.have.property(\"qrCode\");","    pm.expect(jsonData).to.have.property(\"challengeToken\");","});"],"type":"text/javascript"}}],"id":"9ccc5c1a-6a41-4fd4-abee-761a9e0e3dc9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"}],"body":{"mode":"raw","raw":"{\n\t\"challengeToken\": \"{{challengeToken}}\",\n\t\"passcode\": \"722620\"\n}"},"url":"{{protocol}}://{{host}}/api/v1/two-factors"},"response":[],"_postman_id":"9ccc5c1a-6a41-4fd4-abee-761a9e0e3dc9"},{"name":"Create Two Factor Challenge","event":[{"listen":"prerequest","script":{"id":"25997cfb-9666-4718-a84d-c3f0acce2653","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"41fe889c-4aaf-4cf5-8f52-79e748882a60","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.test(\"Contains Valid Response\", function () {","    pm.expect(jsonData).to.be.an('object')","    pm.expect(jsonData).to.have.property(\"secret\"); ","    pm.expect(jsonData).to.have.property(\"qrCode\");","    pm.expect(jsonData).to.have.property(\"challengeToken\");","});"],"type":"text/javascript"}}],"id":"23a0e992-fb6e-462f-bdcd-fb3285e5943b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Accept","value":"application/json; charset=utf-8"},{"key":"Content-Type","value":"application/json; charset=utf-8"}],"body":{"mode":"raw","raw":"{\n   \"token\": \"{{twoFactorOneTimeToken}}\"\n}"},"url":"{{protocol}}://{{host}}/api/v1/two-factors/{{twoFactorId}}/challenges"},"response":[],"_postman_id":"23a0e992-fb6e-462f-bdcd-fb3285e5943b"}],"id":"211eb455-9b35-49f8-b480-06ba29ae310a","_postman_id":"211eb455-9b35-49f8-b480-06ba29ae310a"},{"name":"Health","id":"9c2420eb-d1f2-4108-9768-72920733923e","request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"{{protocol}}://{{host}}/api/v1/health","description":"Checks the health status of the authentication service"},"response":[],"_postman_id":"9c2420eb-d1f2-4108-9768-72920733923e"}],"id":"41bbdadc-2cd4-43de-bb82-80439efb5a39","description":"Folder for v1","_postman_id":"41bbdadc-2cd4-43de-bb82-80439efb5a39"}],"event":[{"listen":"prerequest","script":{"id":"1c04c512-a150-4b57-b07a-590036240cc0","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"d6b393c3-2fcb-4889-b932-59acd86ff567","type":"text/javascript","exec":[""]}}]}