{"id":13635607,"url":"https://github.com/PerfectExamples/Perfect-Authentication-Demo","last_synced_at":"2025-04-19T04:31:18.597Z","repository":{"id":121664413,"uuid":"80060085","full_name":"PerfectExamples/Perfect-Authentication-Demo","owner":"PerfectExamples","description":"OAuth2 Demo","archived":false,"fork":false,"pushed_at":"2018-05-07T14:44:52.000Z","size":1634,"stargazers_count":12,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-09T05:34:36.611Z","etag":null,"topics":["authentication","facebook","github","google","linkedin","oauth2","perfect","salesforce","server-side-swift","swift"],"latest_commit_sha":null,"homepage":"https://github.com/PerfectlySoft/Perfect-Authentication","language":"CSS","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PerfectExamples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-25T21:33:38.000Z","updated_at":"2023-09-04T09:04:11.000Z","dependencies_parsed_at":"2024-08-02T00:13:01.516Z","dependency_job_id":null,"html_url":"https://github.com/PerfectExamples/Perfect-Authentication-Demo","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/PerfectExamples%2FPerfect-Authentication-Demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerfectExamples%2FPerfect-Authentication-Demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerfectExamples%2FPerfect-Authentication-Demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerfectExamples%2FPerfect-Authentication-Demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PerfectExamples","download_url":"https://codeload.github.com/PerfectExamples/Perfect-Authentication-Demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249606322,"owners_count":21298851,"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":["authentication","facebook","github","google","linkedin","oauth2","perfect","salesforce","server-side-swift","swift"],"created_at":"2024-08-02T00:00:48.061Z","updated_at":"2025-04-19T04:31:16.973Z","avatar_url":"https://github.com/PerfectExamples.png","language":"CSS","readme":"# Perfect-Authentication Demo\n\n[![Perfect logo](http://www.perfect.org/github/Perfect_GH_header_854.jpg)](http://perfect.org/get-involved.html)\n\n[![Perfect logo](http://www.perfect.org/github/Perfect_GH_button_1_Star.jpg)](https://github.com/PerfectlySoft/Perfect)\n[![Perfect logo](http://www.perfect.org/github/Perfect_GH_button_2_Git.jpg)](https://gitter.im/PerfectlySoft/Perfect)\n[![Perfect logo](http://www.perfect.org/github/Perfect_GH_button_3_twit.jpg)](https://twitter.com/perfectlysoft)\n[![Perfect logo](http://www.perfect.org/github/Perfect_GH_button_4_slack.jpg)](http://perfect.ly)\n\n\n[![Swift 3.0](https://img.shields.io/badge/Swift-3.0-orange.svg?style=flat)](https://developer.apple.com/swift/)\n[![Platforms OS X | Linux](https://img.shields.io/badge/Platforms-OS%20X%20%7C%20Linux%20-lightgray.svg?style=flat)](https://developer.apple.com/swift/)\n[![License Apache](https://img.shields.io/badge/License-Apache-lightgrey.svg?style=flat)](http://perfect.org/licensing.html)\n[![Twitter](https://img.shields.io/badge/Twitter-@PerfectlySoft-blue.svg?style=flat)](http://twitter.com/PerfectlySoft)\n[![Join the chat at https://gitter.im/PerfectlySoft/Perfect](https://img.shields.io/badge/Gitter-Join%20Chat-brightgreen.svg)](https://gitter.im/PerfectlySoft/Perfect?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Slack Status](http://perfect.ly/badge.svg)](http://perfect.ly) [![GitHub version](https://badge.fury.io/gh/PerfectlySoft%2FPerfect-CURL.svg)](https://badge.fury.io/gh/PerfectlySoft%2FPerfect-CURL)\n\n## Demonstrating the OAuth2 Library for Perfect\n\n\nThis project provides [OAuth2](https://oauth.net/2/) demo of the [Perfect Authentication](https://github.com/PerfectlySoft/Perfect-Authentication) libraries and select OAuth2 provider drivers - Facebook, Google, GitHub.\n\nFull documentation can be found at [http://www.perfect.org/docs/OAuth2.html](http://www.perfect.org/docs/OAuth2.html)\n\nThis package builds with Swift Package Manager and is part of the [Perfect](https://github.com/PerfectlySoft/Perfect) project. It was written to be stand-alone and so does not require PerfectLib or any other components.\n\nEnsure you have installed and activated the latest Swift 3.0 tool chain.\n\n## Setup\n\nDownload this repo, clone it, or import it using [Perfect Assistant](https://www.perfect.org/en/assistant/). Build, configure the system with your AppID's and secrets, and run.\n\n```\ngit clone https://github.com/PerfectExamples/Perfect-Authentication-Demo\ncd Perfect-Authentication-Demo\nswift build\n.build/debug/Perfect-Authentication-Demo\n```\n\nAlternatively, build the Xcode project with `swift package generate-xcodeproj`.\n\nIf you choose to generate an Xcode Project, you MUST change to the executable target AND set the custom working directory to the project directory for its scheme in order for the web routes to work properly.\n\n\n\n## Configuration\n\nEach provider needs an \"appid\", also known as a \"key\", and a \"secret\". These are usually generated by the OAuth Host, such as Facebook, GitHub and Google developer consoles. These values, as well as an \"endpointAfterAuth\" and \"redirectAfterAuth\" value must be set for each provider you wish to use. If you leave any unset, the authentication will fail.\n\nThese settings are configured by removing the \".default\" extension from the \"ApplicationConfiguration.json.default\" file in the \"config\" directory, then populating the values as needed.\n\nThe default file looks like this:\n\n``` swift\n{\n\t\"facebookAppID\": \"---\",\n\t\"facebookSecret\": \"---\",\n\t\"facebookEndpointAfterAuth\": \"http://localhost:8181/auth/response/facebook\",\n\t\"facebookRedirectAfterAuth\":\"http://localhost:8181/\",\n\n\t\"githubKey\": \"---\",\n\t\"githubSecret\": \"---\",\n\t\"githubEndpointAfterAuth\": \"http://localhost:8181/auth/response/github\",\n\t\"githubRedirectAfterAuth\":\"http://localhost:8181/\",\n\n\t\"googleKey\": \"---\",\n\t\"googleSecret\": \"---\",\n\t\"googleEndpointAfterAuth\": \"http://localhost:8181/auth/response/google\",\n\t\"googleRedirectAfterAuth\":\"http://localhost:8181/\"\n}\n```\n\nReplace the `---` values with those from your own accounts.\n\n## Running\n\nOnce the demo has been configured, it can be run from the command line, or from Xcode.\n\nIt can then be accessed from a web browser at `http://localhost:8181`.\n\nThe first page you will see will have the following:\n\n```\nSessionID: \u003c\u003cSessionID\u003e\u003e\n\nLogin Type:\n\nUserID:\n\nUserName:\n\nPicture:\n\nAccessToken:\n```\n\nThese values however will be populated upon login with one of the providers via the buttons.\n\nLogging out will terminate the session, and start a new session without any information gained from a login with a provider.\n\nNote that this demo uses the \"MemorySessions\" driver, so terminating the demo and restarting it will delete all existing sessions.\n\n\n## Further Information\nFor more information on the Perfect project, please visit [perfect.org](http://perfect.org).\n","funding_links":[],"categories":["Samples"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPerfectExamples%2FPerfect-Authentication-Demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPerfectExamples%2FPerfect-Authentication-Demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPerfectExamples%2FPerfect-Authentication-Demo/lists"}