{"id":18897450,"url":"https://github.com/sean-hill/ionic-user-auth-express","last_synced_at":"2025-04-15T02:11:30.473Z","repository":{"id":72985655,"uuid":"27450001","full_name":"sean-hill/ionic-user-auth-express","owner":"sean-hill","description":"Ionic user authentication with Express API","archived":false,"fork":false,"pushed_at":"2017-03-23T05:40:39.000Z","size":1292,"stargazers_count":60,"open_issues_count":1,"forks_count":15,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-15T02:11:25.134Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sean-hill.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-12-02T19:40:48.000Z","updated_at":"2024-01-04T15:58:21.000Z","dependencies_parsed_at":"2023-09-18T15:30:55.724Z","dependency_job_id":null,"html_url":"https://github.com/sean-hill/ionic-user-auth-express","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sean-hill%2Fionic-user-auth-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sean-hill%2Fionic-user-auth-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sean-hill%2Fionic-user-auth-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sean-hill%2Fionic-user-auth-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sean-hill","download_url":"https://codeload.github.com/sean-hill/ionic-user-auth-express/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248991557,"owners_count":21194894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T08:37:29.452Z","updated_at":"2025-04-15T02:11:30.457Z","avatar_url":"https://github.com/sean-hill.png","language":"JavaScript","funding_links":[],"categories":["And A Bunch More! (I am in the process of sorting these)"],"sub_categories":[],"readme":"# Ionic User Authentication with NodeJS\n\nFor your enjoyment this project provides a basic Ionic app and Express server with functionality for user authentication using bearer tokens, as specified by [RFC 6750](http://tools.ietf.org/html/rfc6750).\n\n## Prerequisites\n\n1. Install [npm](https://github.com/npm/npm)\n2. Install [Ionic CLI](http://ionicframework.com/getting-started/)\n3. Install [MongoDB](http://www.mongodb.com/)\n4. Install [Gulp](https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md#getting-started) \n\n## Installation\n\n1. Download project.\n2. Run `npm install` in both `mobile` and `server` directories.\n3. Modify `conf.js` in `server` directory to connect to your MongoDB.\n4. Run `mongod`.\n5. Run `gulp` in `server` directory to start server.\n6. Run `ionic serve` or `ionic build ios; ionic emulate ios;` in `mobile` directory.\n7. Eat cookies\n\nIf using `ionic serve` I used this [solution](http://forum.ionicframework.com/t/solved-cors-with-ionic/7454/7?u=seanhill) to do HTTP requests right from the browser.\n\nThis project has not been tested in an production enviroment, so the API may not work without the `Access-Control-Allow-Origin` being set properly.\n\n\n## Mobile App\n\nThe mobile app is very basic. It starts you off in a \"Welcome\" screen that has one button `Create Profile`. This transitions you into a `Create Profile` page. After creating a profile and storing the `authToken` in the device's local storage, it transitions you to a sample page where you can get a user from the protected `/api/user/get` route. You can also test the `401` server response on this page by clearing out the `authToken` and requesting a user from `/api/user/get`. This causes the mobile app to display a `Login Modal` that requires to first authenticate, and then proceeds to get the user.\n\nThanks to [KD Moore Consulting](http://www.kdmooreconsulting.com/blogs/authentication-with-ionic-and-angular-js-in-a-cordovaphonegap-mobile-web-application/) which provides a more detailed look at this process.\n\n## The Point\n\nI finally figured out how to link up my Ionic App with a backend using bearer tokens for authentication, so I wanted to provide a solution that will hopefully help you on your journey to creating mobile apps.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsean-hill%2Fionic-user-auth-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsean-hill%2Fionic-user-auth-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsean-hill%2Fionic-user-auth-express/lists"}