{"info":{"_postman_id":"52e0fa4e-3d2a-4b52-a124-0013f966f184","name":"NodeJs_Authentication","description":"<html><head></head><body><h1 id=\"introduction\">Introduction</h1>\n<p>An Authorisation API that includes local authentication and oAuth with google, facebook and github.</p>\n<h1 id=\"overview\">Overview</h1>\n<p>Don't forget to create the config file according to the readme</p>\n<h1 id=\"authentication\">Authentication</h1>\n<p>This is an Authentication API</p>\n<h1 id=\"enviromental-variables\">Enviromental Variables</h1>\n<p>Don't forget to set your enviromental variables! </p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Introduction","slug":"introduction"},{"content":"Overview","slug":"overview"},{"content":"Authentication","slug":"authentication"},{"content":"Enviromental Variables","slug":"enviromental-variables"}],"owner":"6959951","collectionId":"52e0fa4e-3d2a-4b52-a124-0013f966f184","publishedId":"S17nUqF1","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2019-03-16T12:29:32.000Z"},"item":[{"name":"users","item":[{"name":"SignUp","id":"53f482c6-224d-4a09-b2cf-676736c98ebd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"email\": \"test.test@gmail.com\",\n\t\"password\": \"test\"\n}"},"url":"http://localhost:{{PORT}}/api/v1/users/signup","description":"<p>Register a new user and save it in MongoDB</p>\n","urlObject":{"protocol":"http","port":"{{PORT}}","path":["api","v1","users","signup"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"f0c200da-1820-4c3b-a126-195cef87f546","name":"409 Email already in use","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"email\": \"test@test.ch\",\n\t\"password\": \"test\"\n}"},"url":"http://localhost:5000/api/v1/users/signup"},"status":"Conflict","code":409,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"35"},{"key":"ETag","value":"W/\"23-OEt1KAmpexNUImW6qjYDZWx9AjE\""},{"key":"Date","value":"Sat, 16 Mar 2019 13:17:29 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Email is already in use\"\n}"},{"id":"f49d438b-2cdc-4d57-8b19-2c092440bc57","name":"200 OK","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"email\": \"test@test.ch\",\n\t\"password\": \"test\"\n}"},"url":"http://localhost:5000/api/v1/users/signup"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJTaWx2YW5LbmVjaHQiLCJzdWIiOiI1YzhjZjcyMmU3ZjIyMjJiMmM2MjJhMDciLCJpYXQiOjE1NTI3NDIxNzg2MzEsImV4cCI6MTU1MjgyODU3ODYzMX0.6Qd557CxU-j6qWjgMSOeVCRYL\"\n}"}],"_postman_id":"53f482c6-224d-4a09-b2cf-676736c98ebd"},{"name":"SignIn","id":"c2c0602d-bb63-4584-a3e7-ae6365f3f275","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"email\": \"test.test@gmail.com\",\n\t\"password\": \"test\"\n}"},"url":"http://localhost:{{PORT}}/api/v1/users/signIn","description":"<p>Log in with an existing user previousely registered</p>\n","urlObject":{"protocol":"http","port":"{{PORT}}","path":["api","v1","users","signIn"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"39e0409f-bced-4578-8f02-17d747cab7dc","name":"200 OK","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"email\": \"test@test.ch\",\n\t\"password\": \"test\"\n}"},"url":"http://localhost:5000/api/v1/users/signIn"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"220"},{"key":"ETag","value":"W/\"dc-cl6wmSihIElwhCBSvJVMRsxvmCs\""},{"key":"Date","value":"Sat, 16 Mar 2019 13:18:25 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJTaWx2YW5LbmVjaHQiLCJzdWIiOiI1YzhjZjcyMmU3ZjIyMjJiMmM2MjJhMDciLCJpYXQiOjE1NTI3NDIzMDU5MzYsImV4cCI6MTU1MjgyODcwNTkzNn0.7vtciyrzxj65x5UO3oB6gHB-APWS\"\n}"}],"_postman_id":"c2c0602d-bb63-4584-a3e7-ae6365f3f275"},{"name":"GoogleOAuth","id":"bd075283-a5c3-44e8-b169-24b94586eb90","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"access_token\": \"{{googleToken}}\"\n}"},"url":"http://localhost:{{PORT}}/api/v1/users/oauth/google","description":"<p>adding a new user with google authentication, returns a json web token, requires public access_token by google</p>\n","urlObject":{"protocol":"http","port":"{{PORT}}","path":["api","v1","users","oauth","google"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"871c2a85-41b3-490e-b2a0-081b7ec21ad4","name":"http://localhost:5000/api/v1/users/oauth/google","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"access_token\": \"{{googleToken}}\"\n}"},"url":"http://localhost:5000/api/v1/users/oauth/google"},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJTaWx2YW5LbmVjaHQiLCJzdWIiOiI1YzhjZjcyMmU3ZjIyMjJiMmM2MjJhMDciLCJpYXQiOjE1NTI3NDIxNzg2MzEsImV4cCI6MTU1MjgyODU3ODYzMX0.6Qd557CxU-j6qWjgMSOeVCRYL\"\n}"}],"_postman_id":"bd075283-a5c3-44e8-b169-24b94586eb90"},{"name":"FacebookOAuth","id":"66a5c22d-dc0a-470b-94ea-f71a13bd2275","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"access_token\": \"{{facebookToken}}\"\n}"},"url":"http://localhost:{{PORT}}/api/v1/users/oauth/facebook","description":"<p>adding a new user with facebook authentication, returns a json web token, requires public access_token by facebook</p>\n","urlObject":{"protocol":"http","port":"{{PORT}}","path":["api","v1","users","oauth","facebook"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"56a218c6-1c3e-4491-8c8f-e94380345d64","name":"http://localhost:5000/api/v1/users/oauth/facebook","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"access_token\": \"{{facebookToken}}\"\n}"},"url":"http://localhost:5000/api/v1/users/oauth/facebook"},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJTaWx2YW5LbmVjaHQiLCJzdWIiOiI1YzhjZjcyMmU3ZjIyMjJiMmM2MjJhMDciLCJpYXQiOjE1NTI3NDIxNzg2MzEsImV4cCI6MTU1MjgyODU3ODYzMX0.6Qd557CxU-j6qWjgMSOeVCRYL\"\n}"}],"_postman_id":"66a5c22d-dc0a-470b-94ea-f71a13bd2275"},{"name":"GithubOAuth","id":"7fe05c6c-c825-46cd-905a-8c269e459004","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"access_token\": \"{{githubToken}}\"\n}"},"url":"http://localhost:{{PORT}}/api/v1/users/oauth/github","description":"<p>adding a new user with github authentication, returns a json web token, requires public access_token by github</p>\n","urlObject":{"protocol":"http","port":"{{PORT}}","path":["api","v1","users","oauth","github"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"623e65c7-b8df-4b53-9689-33e388be9c68","name":"http://localhost:5000/api/v1/users/oauth/github","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"access_token\": \"{{githubToken}}\"\n}"},"url":"http://localhost:5000/api/v1/users/oauth/github"},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJTaWx2YW5LbmVjaHQiLCJzdWIiOiI1YzhjZjcyMmU3ZjIyMjJiMmM2MjJhMDciLCJpYXQiOjE1NTI3NDIxNzg2MzEsImV4cCI6MTU1MjgyODU3ODYzMX0.6Qd557CxU-j6qWjgMSOeVCRYL\"\n}"}],"_postman_id":"7fe05c6c-c825-46cd-905a-8c269e459004"},{"name":"Me","id":"7137b989-d548-48bb-a11e-c33e73fe4b18","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJOb2RlSnNfQXV0aGVudGlmaWNhdGlvbiIsInN1YiI6eyJnb29nbGUiOnsiaWQiOiIxMTE3NzcwMDAzNjY5MTcwMzM1NTgifSwiZmFjZWJvb2siOnsiaWQiOiIyNDMxODExNjAzNTA0Mjg3In0sIm1ldGhvZGVzIjpbImdvb2dsZSIsImZhY2Vib29rIl0sIl9pZCI6IjVjOWI4YTU1MDRhOWQ2MjUxNGEzNjdlMyIsImVtYWlsIjoia25lY2h0LnNpbHZhbkBnbWFpbC5jb20iLCJfX3YiOjB9LCJpYXQiOjE1NTM2OTczNjc4OTgsImV4cCI6MTU1Mzc4Mzc2Nzg5OH0.lR95xdDXo4mxePtZEB5SoGe4net9-_A1","type":"text"}],"url":"http://localhost:{{PORT}}/api/v1/users/me","description":"<p>Access protected source</p>\n","urlObject":{"protocol":"http","port":"{{PORT}}","path":["api","v1","users","me"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"adad7013-e75f-450e-b6e7-74f7235b31f0","name":"http://localhost:5000/api/v1/users/secret","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJTaWx2YW5LbmVjaHQiLCJzdWIiOiI1YzhjZTg5Mjk3ZTA1ZTBhNmNjOTg4NDkiLCJpYXQiOjE1NTI3Mzg0NTA4MDEsImV4cCI6MTU1MjgyNDg1MDgwMX0.RBM-EGLyF60QKvbUK1MJLg59J9mgBuKH2","type":"text"}],"url":"http://localhost:5000/api/v1/users/secret"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\n    \"google\": {\n        \"id\": \"111777000366917033558\"\n    },\n    \"facebook\": {\n        \"id\": \"2431811603504287\"\n    },\n    \"methodes\": [\n        \"google\",\n        \"facebook\"\n    ],\n    \"_id\": \"5c9b8a5504a9d62514a367e3\",\n    \"email\": \"test.test@test.test\",\n    \"__v\": 0\n}"}],"_postman_id":"7137b989-d548-48bb-a11e-c33e73fe4b18"}],"id":"b7266f67-26a0-478f-ab24-087f08a0a331","description":"<p>Contains all requests of the users routes</p>\n","_postman_id":"b7266f67-26a0-478f-ab24-087f08a0a331"}],"event":[{"listen":"prerequest","script":{"id":"43411004-2012-40ec-a165-1873648b9bef","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"d4ab844f-eb91-483e-a432-ce276ddcb2d9","type":"text/javascript","exec":[""]}}]}