{"id":17997110,"url":"https://github.com/emreozdil/gem","last_synced_at":"2025-10-13T21:04:13.378Z","repository":{"id":217218236,"uuid":"106300197","full_name":"emreozdil/GEM","owner":"emreozdil","description":":octocat: Two-factor authentication login iOS application.","archived":false,"fork":false,"pushed_at":"2018-11-28T07:48:37.000Z","size":26002,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-04T06:14:56.880Z","etag":null,"topics":["2fa","2fa-security","2factor","face-detection","face-recognition","ios","swift","swift4","two-factor-authentication"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/emreozdil.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":"2017-10-09T15:17:27.000Z","updated_at":"2019-07-02T13:42:35.000Z","dependencies_parsed_at":"2024-01-15T04:14:17.472Z","dependency_job_id":"8f3dd35c-320a-48fa-b3ed-030f724ba364","html_url":"https://github.com/emreozdil/GEM","commit_stats":null,"previous_names":["emreozdil/gem"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/emreozdil/GEM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emreozdil%2FGEM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emreozdil%2FGEM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emreozdil%2FGEM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emreozdil%2FGEM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emreozdil","download_url":"https://codeload.github.com/emreozdil/GEM/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emreozdil%2FGEM/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017015,"owners_count":26085949,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["2fa","2fa-security","2factor","face-detection","face-recognition","ios","swift","swift4","two-factor-authentication"],"created_at":"2024-10-29T21:16:59.431Z","updated_at":"2025-10-13T21:04:13.362Z","avatar_url":"https://github.com/emreozdil.png","language":"Swift","readme":"# GEM [![Travis CI](https://travis-ci.org/emreozdil/GEM.svg?branch=master)](https://travis-ci.org/emreozdil/GEM/builds)\n\n## Introduction\nTwo-factor authentication login application.\n1. Email and password authentication via Firebase\n2. Facial authentication verifies whether the database view and the current view are the same via Microsoft Face API\n\n## Requirements\n- Swift 4.2\n- Xcode 10.0+\n- Firebase\n- ProjectOxfordFace (Microsoft Face API)\n\n## Usage\nModify project settings and API functions\n\n- Create Firebase Project for email and password authentication\n- Change GoogleService-Info.plist\n- Change Microsoft Face API key\n\n### CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n### Change bundle identifier and development team\n\u003cimg src=\"https://firebasestorage.googleapis.com/v0/b/gem-ios-3a8e7.appspot.com/o/Project%20Settings.png?alt=media\u0026token=6eaf3975-2424-46ac-b827-e42e53f9adbc\"\u003e\n\n\n\n\n### Firebase and ProjectOxfordFace\nUsing Firebase back-end API and ProjectOxfordFace Face API\n\nSet Your Own Face API Key\n```swift\nlet client = MPOFaceServiceClient(subscriptionKey: \"Microsoft Face API KEY\")!\n```\n\n#### Registration\nUser authentication, add to database and store of photo\n\n\u003cimg src=\"/Screenshots/register.PNG\" width=\"320px\"\u003e\n\n##### Register User\n```swift\nAuth.auth().createUser(withEmail: email, password: password) { (user, error) in\n}\n```\n\n##### User Added to Database\n```swift\nguard let uid = user?.uid else {\n    return\n}\nlet ref = Database.database().reference(fromURL: \"FIREBASE_URL\")\nlet userReference = ref.child(\"users\").child(uid)\n\nlet values = [\n    \"name\": name,\n    \"email\": email,\n    \"password\": shaHex // sha256 password\n]\nuserReference.updateChildValues(values, withCompletionBlock: { (error, reference) in\n}\n```\n##### User Photo Detect and Save Storage\n```swift\nlet userID = Auth.auth().currentUser?.uid\nlet imageRef = usersStorageRef.child(\"\\(userID!).jpg\")\n\nclient.detect(with: data!, returnFaceId: true, returnFaceLandmarks: true, returnFaceAttributes: [], completionBlock: { (faces, error) in\n\n    let uploadTask = imageRef.putData(dataImage, metadata: nil, completion: { (metadata, error) in\n\n    })\n\n    uploadTask.resume()\n\n})\n```\n\u003cimg src=\"/Screenshots/camera.PNG\" width=\"320px\"\u003e\u003cimg src=\"/Screenshots/welcome.PNG\" width=\"320px\"\u003e\n\n#### Login\nUser authentication, verify between storage photo and real-time photo\n\n\u003cimg src=\"/Screenshots/login.PNG\" width=\"320px\"\u003e\n\n##### Login User\n```swift\nAuth.auth().signIn(withEmail: email, password: password) { (user, error) in\n}\n```\n\n##### Verify Photos\n```swift\nvar faceFromPhoto: MPOFace!\nvar faceFromFirebase: MPOFace!\n\n// Detect real-time photo\nclient.detect(with: data, returnFaceId: true, returnFaceLandmarks: true, returnFaceAttributes: [], completionBlock: { (faces, error) in\n  self.faceFromPhoto = faces![0]\n\n  // Detect storage photo\n  client.detect(withUrl: url, returnFaceId: true, returnFaceLandmarks: true, returnFaceAttributes: [], completionBlock: { (faces, error) in\n      self.faceFromFirebase = faces![0]\n\n        // Verify photos\n        client.verify(withFirstFaceId: self.faceFromPhoto.faceId, faceId2: self.faceFromFirebase.faceId, completionBlock: { (result, error) in\n            if result!.isIdentical {\n                // THE PERSON IS THE SAME\n                // Open logged in view\n            }\n        })\n    })\n})\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femreozdil%2Fgem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femreozdil%2Fgem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femreozdil%2Fgem/lists"}