{"id":22268194,"url":"https://github.com/curityio/openid-client-ios-appauth-dcr","last_synced_at":"2025-03-25T14:45:43.851Z","repository":{"id":74437582,"uuid":"409868331","full_name":"curityio/openid-client-ios-appauth-dcr","owner":"curityio","description":"Extended OpenID Connect iOS integration in a SwiftUI app using the AppAuth pattern and Dynamic Client Registration","archived":false,"fork":false,"pushed_at":"2023-03-10T10:02:14.000Z","size":451,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-30T13:31:23.030Z","etag":null,"topics":["appauth","code-example","dynamic-client-registration","ios","mobile","oauth2","openid-connect"],"latest_commit_sha":null,"homepage":"https://curity.io/resources/learn/authenticated-dcr-example/","language":"Swift","has_issues":true,"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/curityio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-09-24T07:11:27.000Z","updated_at":"2023-04-26T10:29:35.000Z","dependencies_parsed_at":"2024-12-03T11:11:56.345Z","dependency_job_id":"728fb801-05b2-4fd1-820f-59ded39bceae","html_url":"https://github.com/curityio/openid-client-ios-appauth-dcr","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/curityio%2Fopenid-client-ios-appauth-dcr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fopenid-client-ios-appauth-dcr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fopenid-client-ios-appauth-dcr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fopenid-client-ios-appauth-dcr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/curityio","download_url":"https://codeload.github.com/curityio/openid-client-ios-appauth-dcr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245486237,"owners_count":20623239,"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":["appauth","code-example","dynamic-client-registration","ios","mobile","oauth2","openid-connect"],"created_at":"2024-12-03T11:11:51.680Z","updated_at":"2025-03-25T14:45:43.818Z","avatar_url":"https://github.com/curityio.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AppAuth with Dynamic Client Registration\n\nAn extended iOS AppAuth code example using authenticated Dynamic Client Registration.\\\nThis improves the mobile app's security as described in [Mobile Best Practices](https://curity.io/resources/learn/oauth-for-mobile-apps-best-practices/).\n\n## Tutorial Documentation\n\nThe [Tutorial Walkthrough](https://curity.io/resources/learn/authenticated-dcr-example/) explains the complete configuration and behavior.\n\n## Quick Start\n\nThe easiest way to run the code example is via an automated script as explained in the [Mobile Setup Article](https://curity.io/resources/learn/mobile-setup-ngrok):\n\n- Copy a license.json file into the code example root folder\n- Edit the `./start-idsvr.sh` script to use either a local Docker URL on an ngrok internet URL\n- Run the script to deploy a preconfigured Curity Identity Server via Docker\n- Build and run the mobile app from Xcode\n- Sign in with the preconfigured user account `demouser / Password1`\n- Run `./stop-idsvr.sh` when you want to free Docker resources\n\n## User Experience\n\nWhen the user first runs the app there is a prompt to authenticate.\\\nThis gets an initial access token with the `dcr` scope.\\\nThis is then used to create a Dynamic Client, which returns a Client ID and Client Secret.\n\n![images](/images/registration-view.png)\n\nThe user must then authenticate again, and this is automatic via Single Sign On.\\\nOn all subsequent authentication requests the user only needs to sign in once:\n\n![images](/images/unauthenticated-view.png)\n\nOnce authenticated, the user is moved to the authenticated view.\\\nThe demo app simply allows other OAuth lifecycle events to be tested.\n\n![images](/images/authenticated-view.png)\n\n## Manage Registration Details\n\nTo view all registered mobile instances, first connect to the Identity Server's SQL database:\n\n```bash\nexport DB_CONTAINER_ID=$(docker container ls | grep curity-data | awk '{print $1}')\ndocker exec -it $DB_CONTAINER_ID bash -c \"export PGPASSWORD=Password1 \u0026\u0026 psql -p 5432 -d idsvr -U postgres\"\n```\n\nThen query the details of the dynamically registered mobile clients:\n\n```bash\nselect * from dynamically_registered_clients;\n```\n\n## More Information\n\nPlease visit [curity.io](https://curity.io/) for more information about the Curity Identity Server.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurityio%2Fopenid-client-ios-appauth-dcr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcurityio%2Fopenid-client-ios-appauth-dcr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurityio%2Fopenid-client-ios-appauth-dcr/lists"}